@@ -236,61 +236,61 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
236
236
@ rem also if both are x86
237
237
if %target_arch% == x86 if %msvs_host_arch% == x86 set vcvarsall_arg = x86
238
238
239
- @ rem Look for Visual Studio 2017
240
- :vs-set-2017
241
- if defined target_env if " %target_env% " NEQ " vs2017 " goto vs-set-2019
242
- echo Looking for Visual Studio 2017
243
- call tools\msvs\vswhere_usability_wrapper.cmd " [15 .0,16 .0)"
244
- if " _%VCINSTALLDIR% _" == " __" goto msbuild-not-found
239
+ @ rem Look for Visual Studio 2019
240
+ :vs-set-2019
241
+ if defined target_env if " %target_env% " NEQ " vs2019 " goto vs-set-2017
242
+ echo Looking for Visual Studio 2019
243
+ call tools\msvs\vswhere_usability_wrapper.cmd " [16 .0,17 .0)"
244
+ if " _%VCINSTALLDIR% _" == " __" goto vs-set-2017
245
245
if defined msi (
246
- echo Looking for WiX installation for Visual Studio 2017 ...
246
+ echo Looking for WiX installation for Visual Studio 2019 ...
247
247
if not exist " %WIX% \SDK\VS2017" (
248
- echo Failed to find WiX install for Visual Studio 2017
249
- echo VS2017 support for WiX is only present starting at version 3.11
250
- goto msbuild-not-found
248
+ echo Failed to find WiX install for Visual Studio 2019
249
+ echo VS2019 support for WiX is only present starting at version 3.11
250
+ goto vs-set-2017
251
251
)
252
252
if not exist " %VCINSTALLDIR% \..\MSBuild\Microsoft\WiX" (
253
- echo Failed to find the WiX Toolset Visual Studio 2017 Extension
254
- goto msbuild-not-found
253
+ echo Failed to find the WiX Toolset Visual Studio 2019 Extension
254
+ goto vs-set-2017
255
255
)
256
256
)
257
- @ rem check if VS2017 is already setup, and for the requested arch
258
- if " _%VisualStudioVersion% _" == " _15 .0_" if " _%VSCMD_ARG_TGT_ARCH% _" == " _%target_arch% _" goto found_vs2017
257
+ @ rem check if VS2019 is already setup, and for the requested arch
258
+ if " _%VisualStudioVersion% _" == " _16 .0_" if " _%VSCMD_ARG_TGT_ARCH% _" == " _%target_arch% _" goto found_vs2019
259
259
@ rem need to clear VSINSTALLDIR for vcvarsall to work as expected
260
260
set " VSINSTALLDIR = "
261
261
@ rem prevent VsDevCmd.bat from changing the current working directory
262
262
set " VSCMD_START_DIR = %CD% "
263
263
set vcvars_call = " %VCINSTALLDIR% \Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
264
264
echo calling: %vcvars_call%
265
265
call %vcvars_call%
266
- if errorlevel 1 goto msbuild-not-found
266
+ if errorlevel 1 goto vs-set-2017
267
267
if defined DEBUG_HELPER @ ECHO ON
268
- :found_vs2017
268
+ :found_vs2019
269
269
echo Found MSVS version %VisualStudioVersion%
270
- set GYP_MSVS_VERSION = 2017
271
- set PLATFORM_TOOLSET = v141
270
+ set GYP_MSVS_VERSION = 2019
271
+ set PLATFORM_TOOLSET = v142
272
272
goto msbuild-found
273
273
274
- @ rem Look for Visual Studio 2019
275
- :vs-set-2019
276
- if defined target_env if " %target_env% " NEQ " vs2019 " goto msbuild-not-found
277
- echo Looking for Visual Studio 2019
278
- call tools\msvs\vswhere_usability_wrapper.cmd " [16 .0,17 .0)"
274
+ @ rem Look for Visual Studio 2017
275
+ :vs-set-2017
276
+ if defined target_env if " %target_env% " NEQ " vs2017 " goto msbuild-not-found
277
+ echo Looking for Visual Studio 2017
278
+ call tools\msvs\vswhere_usability_wrapper.cmd " [15 .0,16 .0)"
279
279
if " _%VCINSTALLDIR% _" == " __" goto msbuild-not-found
280
280
if defined msi (
281
- echo Looking for WiX installation for Visual Studio 2019 ...
281
+ echo Looking for WiX installation for Visual Studio 2017 ...
282
282
if not exist " %WIX% \SDK\VS2017" (
283
- echo Failed to find WiX install for Visual Studio 2019
284
- echo VS2019 support for WiX is only present starting at version 3.11
283
+ echo Failed to find WiX install for Visual Studio 2017
284
+ echo VS2017 support for WiX is only present starting at version 3.11
285
285
goto msbuild-not-found
286
286
)
287
287
if not exist " %VCINSTALLDIR% \..\MSBuild\Microsoft\WiX" (
288
- echo Failed to find the WiX Toolset Visual Studio 2019 Extension
288
+ echo Failed to find the WiX Toolset Visual Studio 2017 Extension
289
289
goto msbuild-not-found
290
290
)
291
291
)
292
- @ rem check if VS2019 is already setup, and for the requested arch
293
- if " _%VisualStudioVersion% _" == " _16 .0_" if " _%VSCMD_ARG_TGT_ARCH% _" == " _%target_arch% _" goto found_vs2019
292
+ @ rem check if VS2017 is already setup, and for the requested arch
293
+ if " _%VisualStudioVersion% _" == " _15 .0_" if " _%VSCMD_ARG_TGT_ARCH% _" == " _%target_arch% _" goto found_vs2017
294
294
@ rem need to clear VSINSTALLDIR for vcvarsall to work as expected
295
295
set " VSINSTALLDIR = "
296
296
@ rem prevent VsDevCmd.bat from changing the current working directory
@@ -300,10 +300,10 @@ echo calling: %vcvars_call%
300
300
call %vcvars_call%
301
301
if errorlevel 1 goto msbuild-not-found
302
302
if defined DEBUG_HELPER @ ECHO ON
303
- :found_vs2019
303
+ :found_vs2017
304
304
echo Found MSVS version %VisualStudioVersion%
305
- set GYP_MSVS_VERSION = 2019
306
- set PLATFORM_TOOLSET = v142
305
+ set GYP_MSVS_VERSION = 2017
306
+ set PLATFORM_TOOLSET = v141
307
307
goto msbuild-found
308
308
309
309
:msbuild-not-found
0 commit comments