@@ -15,7 +15,7 @@ if /i "%1"=="/?" goto help
15
15
set config = Release
16
16
set target = Build
17
17
set target_arch = x64
18
- set target_env = vs2015
18
+ set target_env =
19
19
set noprojgen =
20
20
set nobuild =
21
21
set sign =
@@ -164,18 +164,18 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
164
164
165
165
@ rem Look for Visual Studio 2017
166
166
:vs-set-2017
167
- if " %target_env% " NEQ " vs2017" goto vs-set-2015
167
+ if defined target_env if " %target_env% " NEQ " vs2017" goto vs-set-2015
168
168
echo Looking for Visual Studio 2017
169
169
@ rem check if VS2017 is already setup, and for the requested arch
170
170
if " _%VisualStudioVersion% _" == " _15.0_" if " _%VSCMD_ARG_TGT_ARCH% _" == " _%target_arch% _" goto found_vs2017
171
+ @ rem need to clear VSINSTALLDIR for vcvarsall to work as expected
171
172
set " VSINSTALLDIR = "
172
173
call tools\msvs\vswhere_usability_wrapper.cmd
173
174
if " _%VCINSTALLDIR% _" == " __" goto vs-set-2015
174
- @ rem need to clear VSINSTALLDIR for vcvarsall to work as expected
175
175
set vcvars_call = " %VCINSTALLDIR% \Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
176
176
echo calling: %vcvars_call%
177
177
call %vcvars_call%
178
-
178
+ if errorlevel 1 goto vs-set-2015
179
179
:found_vs2017
180
180
echo Found MSVS version %VisualStudioVersion%
181
181
set GYP_MSVS_VERSION = 2017
@@ -184,11 +184,10 @@ goto msbuild-found
184
184
185
185
@ rem Look for Visual Studio 2015
186
186
:vs-set-2015
187
- if " %target_env% " NEQ " vs2015" goto msbuild-not-found
187
+ if defined target_env if " %target_env% " NEQ " vs2015" goto msbuild-not-found
188
188
echo Looking for Visual Studio 2015
189
189
if not defined VS140COMNTOOLS goto msbuild-not-found
190
190
if not exist " %VS140COMNTOOLS% \..\..\vc\vcvarsall.bat" goto msbuild-not-found
191
- echo Found Visual Studio 2015
192
191
if defined msi (
193
192
echo Looking for WiX installation for Visual Studio 2015...
194
193
if not exist " %WIX% \SDK\VS2015" (
@@ -201,6 +200,8 @@ if defined msi (
201
200
call " %VS140COMNTOOLS% \..\..\vc\vcvarsall.bat"
202
201
SET VCVARS_VER = 140
203
202
if not defined VCINSTALLDIR goto msbuild-not-found
203
+ @ rem Visual C++ Build Tools 2015 does not define VisualStudioVersion
204
+ echo Found MSVS version 14.0
204
205
set GYP_MSVS_VERSION = 2015
205
206
set PLATFORM_TOOLSET = v140
206
207
goto msbuild-found
0 commit comments