Skip to content

Commit 866c44c

Browse files
committed
also generate vs2026 directory for testing with visual studio 2026
needs to be manually retargetted in vs 2026 because premake5 hasn't yet released a build with vs2026 target so I'm generating vs 2022 files in that dir
1 parent cdadfde commit 866c44c

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ docs/md/.obsidian/workspace.json
5050
docs/manual.dat
5151

5252
vs2022-clang/
53+
vs2026/

do/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ func getSecrets() {
7070

7171
func regenPremake() {
7272
premakePath := filepath.Join("bin", "premake5.exe")
73+
// TODO: with premake5 beta 8 switch to using vs2026 action
74+
{
75+
cmd := exec.Command(premakePath, "--with-2026", "vs2022")
76+
runCmdLoggedMust(cmd)
77+
}
7378
{
7479
cmd := exec.Command(premakePath, "vs2022")
7580
runCmdLoggedMust(cmd)
7681
}
77-
7882
{
7983
cmd := exec.Command(premakePath, "--with-clang", "vs2022")
8084
runCmdLoggedMust(cmd)

premake5.lua

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ newoption {
6161
description = "use clang-cl.exe instead of cl.exe"
6262
}
6363

64+
-- TODO: won't be needed with premake5 beta 8
65+
newoption {
66+
trigger = "with-2026",
67+
description = "use vs2026 directory"
68+
}
69+
6470
-- TODO: test this option
6571
-- usestandardpreprocessor 'On'
6672

@@ -139,6 +145,16 @@ function optimized_conf()
139145
filter {}
140146
end
141147

148+
-- TODO: temporary, create 2022 project in 2026
149+
-- directory and then needs manual retarget in vs2026
150+
-- in premake5 beta 8 (not yet released) vs2026 action
151+
-- is supported and we'll be able to switch to that
152+
function conf_2026()
153+
filter { "options:with-2026" }
154+
location "vs2026"
155+
filter {}
156+
end
157+
142158
-- per-workspace setting that differ in clang-cl.exe vs cl.exe builds
143159
function clang_conf()
144160
filter "options:with-clang"
@@ -214,7 +230,9 @@ workspace "SumatraPDF"
214230
location "vs2022"
215231
filter {}
216232

233+
217234
clang_conf()
235+
conf_2026()
218236

219237
filter {"platforms:x32", "configurations:Release"}
220238
targetdir "out/rel32"
@@ -287,7 +305,7 @@ workspace "SumatraPDF"
287305
optimized_conf()
288306
defines { "UNRAR", "RARDLL", "SILENT" }
289307
-- os.hpp redefines WINVER, is there a better way?
290-
disablewarnings { "4005", "4100", "4201", "4211", "4244", "4310", "4389", "4456", "4459", "4505", "4701", "4702", "4706", "4709", "4731", "4996" }
308+
disablewarnings { "4005", "4100", "4201", "4211", "4244", "4310", "4389", "4456", "4459", "4505", "4701", "4702", "4706", "4709", "4731", "4996" }
291309
-- unrar uses exception handling in savepos.hpp but I don't want to enable it
292310
-- as it seems to infect the Sumatra binary as well (i.e. I see bad alloc exception
293311
-- being thrown)
@@ -499,7 +517,7 @@ workspace "SumatraPDF"
499517
files { "ext/mujs/one.c", "ext/mujs/mujs.h" }
500518

501519
-- gumbo
502-
disablewarnings { "4018", "4100", "4132", "4204", "4244", "4245", "4267",
520+
disablewarnings { "4018", "4100", "4132", "4204", "4244", "4245", "4267",
503521
"4305", "4306", "4389", "4456", "4701" }
504522
includedirs { "ext/gumbo-parser/include", "ext/gumbo-parser/visualc/include" }
505523
gumbo_files()
@@ -588,7 +606,7 @@ workspace "SumatraPDF"
588606
filter {}
589607

590608
disablewarnings {
591-
"4005", "4018", "4057", "4100", "4115", "4130", "4132", "4200", "4204", "4206", "4210",
609+
"4005", "4018", "4057", "4100", "4115", "4130", "4132", "4200", "4204", "4206", "4210",
592610
"4245", "4267", "4295", "4305", "4389", "4456", "4457", "4703", "4706", "4819", "5286"
593611
}
594612
-- force including mupdf/scripts/openjpeg/opj_config_private.h
@@ -918,8 +936,9 @@ workspace "MakeLZSA"
918936
filter "action:vs2022"
919937
location "vs2022"
920938
filter {}
921-
939+
922940
clang_conf()
941+
conf_2026()
923942

924943
filter {"platforms:x32", "configurations:Release"}
925944
targetdir "out/rel32"

0 commit comments

Comments
 (0)