Skip to content

Commit

Permalink
build,windows: check for VS version and arch
Browse files Browse the repository at this point in the history
PR-URL: nodejs#13485
Fixes: nodejs#13398
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
refack committed Jun 10, 2017
1 parent 24e5b67 commit 780acc2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,16 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
:vs-set-2017
if "%target_env%" NEQ "vs2017" goto vs-set-2015
echo Looking for Visual Studio 2017
if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2017
@rem check if VS2017 is already setup, and for the requested arch
if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2017
set "VSINSTALLDIR="
call tools\msvs\vswhere_usability_wrapper.cmd
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
echo calling: %vcvars_call%
call %vcvars_call%

:found_vs2017
echo Found MSVS version %VisualStudioVersion%
set GYP_MSVS_VERSION=2017
Expand All @@ -193,10 +197,9 @@ if defined msi (
goto wix-not-found
)
)
if "%VCVARS_VER%" NEQ "140" (
call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat"
SET VCVARS_VER=140
)
@rem VS2015 vsvarsall is quick, so run anyway
call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat"
SET VCVARS_VER=140
if not defined VCINSTALLDIR goto msbuild-not-found
set GYP_MSVS_VERSION=2015
set PLATFORM_TOOLSET=v140
Expand Down

0 comments on commit 780acc2

Please sign in to comment.