Skip to content

Commit c939ac6

Browse files
BuildEngine.ps1 Update with missing functionality (#503)
- Add RunBuilds Option support to enable configure only option - Add Visual Studio Version Selection to support VsVersion 2022 and the new 2026 Co-authored-by: Mathew Benson <mathew@benson.co.ke>
1 parent e18258c commit c939ac6

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

CMakePresets.json

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
}
5757
},
5858
{
59-
"name": "Windows_x64_Debug",
59+
"name": "Windows_x64_Debug_2022",
6060
"inherits": "BaseOptions",
61-
"displayName": "Windows Visual Studio Debug",
61+
"displayName": "Windows Visual Studio 2022 Debug",
6262
"generator": "Visual Studio 17 2022",
6363
"binaryDir": "Result.Windows.x64.MultiConfig",
6464
"architecture": "x64",
@@ -69,14 +69,28 @@
6969

7070
},
7171
{
72-
"name": "Windows_x64_Release",
73-
"displayName": "Windows Visual Studio Release",
74-
"inherits": "Windows_x64_Debug",
72+
"name": "Windows_x64_Release_2022",
73+
"displayName": "Windows Visual Studio 2022 Release",
74+
"inherits": "Windows_x64_Debug_2022",
7575
"cacheVariables": {
7676
"CMAKE_CONFIGURATION_TYPES": "Release"
7777
}
7878
},
7979

80+
{
81+
"name": "Windows_x64_Debug_2026",
82+
"inherits": "Windows_x64_Debug_2022",
83+
"displayName": "Windows Visual Studio 2026 Debug",
84+
"generator": "Visual Studio 18 2026"
85+
},
86+
87+
{
88+
"name": "Windows_x64_Release_2026",
89+
"inherits": "Windows_x64_Release_2022",
90+
"displayName": "Windows Visual Studio 2026 Release",
91+
"generator": "Visual Studio 18 2026"
92+
},
93+
8094
{
8195
"name": "Darwin_x64_Debug",
8296
"inherits": "BaseOptions",
@@ -146,22 +160,34 @@
146160

147161
"buildPresets": [
148162
{
149-
"name": "Windows_x64_Debug",
150-
"configurePreset": "Windows_x64_Debug",
163+
"name": "Windows_x64_Debug_2022",
164+
"configurePreset": "Windows_x64_Debug_2022",
151165
"configuration": "Debug",
152166
"nativeToolOptions": [
153167
"-nodeReuse:false"
154168
]
155169
},
156170
{
157-
"name": "Windows_x64_Release",
158-
"configurePreset": "Windows_x64_Release",
171+
"name": "Windows_x64_Release_2022",
172+
"configurePreset": "Windows_x64_Release_2022",
159173
"configuration": "Release",
160174
"nativeToolOptions": [
161175
"-nodeReuse:false"
162176
]
163177
},
164178

179+
{
180+
"name": "Windows_x64_Debug_2026",
181+
"inherits": "Windows_x64_Debug_2022",
182+
"configurePreset": "Windows_x64_Debug_2026"
183+
},
184+
185+
{
186+
"name": "Windows_x64_Release_2026",
187+
"inherits": "Windows_x64_Release_2022",
188+
"configurePreset": "Windows_x64_Release_2026"
189+
},
190+
165191
{
166192
"name": "Darwin_x64_Debug",
167193
"configuration": "Debug",

Scripts/BuildEngine.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ param (
4242
[bool] $VerifyFormatting = $False,
4343

4444
[Parameter(HelpMessage = "VS version use to build, default to 2022")]
45-
[ValidateSet(2022)]
45+
[ValidateSet('2022', '2026')]
4646
[int] $VsVersion = 2022,
4747

4848
[Parameter(HelpMessage = "Build Launcher only")]
@@ -121,6 +121,10 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
121121
# Define CMake Generator arguments
122122
$configName = $systemName, $architecture, $configuration -join "_"
123123

124+
if($IsWindows){
125+
$configName += '_'+$VsVersion
126+
}
127+
124128
$cMakeArguments = " --preset $configName $cMakeCacheVariableOverride"
125129

126130
# CMake Generation process
@@ -130,8 +134,9 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
130134
throw "cmake failed generation for '$cMakeArguments' with exit code '$cMakeProcess.ExitCode'"
131135
}
132136

137+
138+
if ($runBuild) {
133139
# CMake Build Process
134-
#
135140

136141
Write-Host "Building $systemName $architecture $configuration"
137142

@@ -166,6 +171,7 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
166171
if($installProcess.ExitCode -ne 0){
167172
throw "cmake failed to install to '$install_directory'"
168173
}
174+
}
169175
}
170176

171177

0 commit comments

Comments
 (0)