summaryrefslogtreecommitdiff
path: root/vcbuild.bat
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-10-18 11:04:35 +0200
committerMichaël Zasso <targos@protonmail.com>2019-10-20 16:08:15 +0200
commitb554214249b4d03ca68f98f2a2715511a7049397 (patch)
tree89ab2b46d33abc78208f4eee2ffe8557857274aa /vcbuild.bat
parenta4e075f66833d08fc426c9406eb3894ec56326c1 (diff)
downloadandroid-node-v8-b554214249b4d03ca68f98f2a2715511a7049397.tar.gz
android-node-v8-b554214249b4d03ca68f98f2a2715511a7049397.tar.bz2
android-node-v8-b554214249b4d03ca68f98f2a2715511a7049397.zip
build: default Windows build to Visual Studio 2019
Building and testing Node.js with Visual Studio 2019 is now working as expected. Fallback to VS 2017 if VS 2019 was not found. Fixes: https://github.com/nodejs/node/issues/27214 PR-URL: https://github.com/nodejs/node/pull/30022 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Diffstat (limited to 'vcbuild.bat')
-rw-r--r--vcbuild.bat64
1 files changed, 32 insertions, 32 deletions
diff --git a/vcbuild.bat b/vcbuild.bat
index 7613bd8b5a..5ddc04aeb2 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -236,26 +236,26 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64
@rem also if both are x86
if %target_arch%==x86 if %msvs_host_arch%==x86 set vcvarsall_arg=x86
-@rem Look for Visual Studio 2017
-:vs-set-2017
-if defined target_env if "%target_env%" NEQ "vs2017" goto vs-set-2019
-echo Looking for Visual Studio 2017
-call tools\msvs\vswhere_usability_wrapper.cmd "[15.0,16.0)"
-if "_%VCINSTALLDIR%_" == "__" goto msbuild-not-found
+@rem Look for Visual Studio 2019
+:vs-set-2019
+if defined target_env if "%target_env%" NEQ "vs2019" goto vs-set-2017
+echo Looking for Visual Studio 2019
+call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)"
+if "_%VCINSTALLDIR%_" == "__" goto vs-set-2017
if defined msi (
- echo Looking for WiX installation for Visual Studio 2017...
+ echo Looking for WiX installation for Visual Studio 2019...
if not exist "%WIX%\SDK\VS2017" (
- echo Failed to find WiX install for Visual Studio 2017
- echo VS2017 support for WiX is only present starting at version 3.11
- goto msbuild-not-found
+ echo Failed to find WiX install for Visual Studio 2019
+ echo VS2019 support for WiX is only present starting at version 3.11
+ goto vs-set-2017
)
if not exist "%VCINSTALLDIR%\..\MSBuild\Microsoft\WiX" (
- echo Failed to find the WiX Toolset Visual Studio 2017 Extension
- goto msbuild-not-found
+ echo Failed to find the WiX Toolset Visual Studio 2019 Extension
+ goto vs-set-2017
)
)
-@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
+@rem check if VS2019 is already setup, and for the requested arch
+if "_%VisualStudioVersion%_" == "_16.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2019
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
set "VSINSTALLDIR="
@rem prevent VsDevCmd.bat from changing the current working directory
@@ -263,34 +263,34 @@ set "VSCMD_START_DIR=%CD%"
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
echo calling: %vcvars_call%
call %vcvars_call%
-if errorlevel 1 goto msbuild-not-found
+if errorlevel 1 goto vs-set-2017
if defined DEBUG_HELPER @ECHO ON
-:found_vs2017
+:found_vs2019
echo Found MSVS version %VisualStudioVersion%
-set GYP_MSVS_VERSION=2017
-set PLATFORM_TOOLSET=v141
+set GYP_MSVS_VERSION=2019
+set PLATFORM_TOOLSET=v142
goto msbuild-found
-@rem Look for Visual Studio 2019
-:vs-set-2019
-if defined target_env if "%target_env%" NEQ "vs2019" goto msbuild-not-found
-echo Looking for Visual Studio 2019
-call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)"
+@rem Look for Visual Studio 2017
+:vs-set-2017
+if defined target_env if "%target_env%" NEQ "vs2017" goto msbuild-not-found
+echo Looking for Visual Studio 2017
+call tools\msvs\vswhere_usability_wrapper.cmd "[15.0,16.0)"
if "_%VCINSTALLDIR%_" == "__" goto msbuild-not-found
if defined msi (
- echo Looking for WiX installation for Visual Studio 2019...
+ echo Looking for WiX installation for Visual Studio 2017...
if not exist "%WIX%\SDK\VS2017" (
- echo Failed to find WiX install for Visual Studio 2019
- echo VS2019 support for WiX is only present starting at version 3.11
+ echo Failed to find WiX install for Visual Studio 2017
+ echo VS2017 support for WiX is only present starting at version 3.11
goto msbuild-not-found
)
if not exist "%VCINSTALLDIR%\..\MSBuild\Microsoft\WiX" (
- echo Failed to find the WiX Toolset Visual Studio 2019 Extension
+ echo Failed to find the WiX Toolset Visual Studio 2017 Extension
goto msbuild-not-found
)
)
-@rem check if VS2019 is already setup, and for the requested arch
-if "_%VisualStudioVersion%_" == "_16.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2019
+@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
@rem need to clear VSINSTALLDIR for vcvarsall to work as expected
set "VSINSTALLDIR="
@rem prevent VsDevCmd.bat from changing the current working directory
@@ -300,10 +300,10 @@ echo calling: %vcvars_call%
call %vcvars_call%
if errorlevel 1 goto msbuild-not-found
if defined DEBUG_HELPER @ECHO ON
-:found_vs2019
+:found_vs2017
echo Found MSVS version %VisualStudioVersion%
-set GYP_MSVS_VERSION=2019
-set PLATFORM_TOOLSET=v142
+set GYP_MSVS_VERSION=2017
+set PLATFORM_TOOLSET=v141
goto msbuild-found
:msbuild-not-found