@@ -326,26 +326,39 @@ function Start-BuildNativeWindowsBinaries {
326
326
try {
327
327
Push-Location " $PSScriptRoot \src\powershell-native"
328
328
329
- # setup cmakeGenerator
330
- $cmakeGeneratorPlatform = " "
331
- if ($Arch -eq ' x86' ) {
332
- $cmakeGenerator = ' Visual Studio 17 2022'
333
- $cmakeArch = ' x86'
334
- $cmakeGeneratorPlatform = " -A Win32"
335
- } elseif ($Arch -eq ' x64_arm' ) {
336
- $cmakeGenerator = ' Visual Studio 17 2022'
337
- $cmakeArch = ' arm'
338
- $cmakeGeneratorPlatform = " -A ARM"
339
- } elseif ($Arch -eq ' x64_arm64' ) {
340
- $cmakeGenerator = ' Visual Studio 17 2022'
341
- $cmakeArch = ' arm64'
342
- $cmakeGeneratorPlatform = " -A ARM64"
343
- } else {
344
- $cmakeGenerator = ' Visual Studio 17 2022'
345
- $cmakeArch = ' x64'
346
- $cmakeGeneratorPlatform = " -A x64"
329
+ if ($vcPath -notlike ' *14.0*' ) {
330
+ # setup cmakeGenerator
331
+ $cmakeGeneratorPlatform = " "
332
+ if ($Arch -eq ' x86' ) {
333
+ $cmakeGenerator = ' Visual Studio 17 2022'
334
+ $cmakeArch = ' x86'
335
+ $cmakeGeneratorPlatform = " -A Win32"
336
+ } elseif ($Arch -eq ' x64_arm64' ) {
337
+ $cmakeGenerator = ' Visual Studio 17 2022'
338
+ $cmakeArch = ' arm64'
339
+ $cmakeGeneratorPlatform = " -A ARM64"
340
+ } else {
341
+ $cmakeGenerator = ' Visual Studio 17 2022'
342
+ $cmakeArch = ' x64'
343
+ $cmakeGeneratorPlatform = " -A x64"
344
+ }
345
+ }
346
+ else {
347
+ # setup cmakeGenerator
348
+ $cmakeGeneratorPlatform = " "
349
+ if ($Arch -eq ' x86' ) {
350
+ $cmakeGenerator = ' Visual Studio 15 2017'
351
+ $cmakeArch = ' x86'
352
+ } elseif ($Arch -eq ' x64_arm64' ) {
353
+ $cmakeGenerator = ' Visual Studio 15 2017'
354
+ $cmakeArch = ' arm64'
355
+ $cmakeGeneratorPlatform = " -A ARM64"
356
+ } else {
357
+ $cmakeGenerator = ' Visual Studio 15 2017 Win64'
358
+ $cmakeArch = ' x64'
359
+ $cmakeGeneratorPlatform = " -A x64"
360
+ }
347
361
}
348
-
349
362
# Compile native resources
350
363
$currentLocation = Get-Location
351
364
$savedPath = $env: PATH
0 commit comments