summaryrefslogtreecommitdiff
path: root/vcbuild.bat
diff options
context:
space:
mode:
authorRichard Lau <riclau@uk.ibm.com>2019-10-25 17:13:49 +0100
committerRichard Lau <riclau@uk.ibm.com>2019-11-04 22:41:31 -0500
commit1f2fdc9538f2ee9d9fad68137798c49113e96274 (patch)
tree3934c485f84e22af815d38917344bc174c04131b /vcbuild.bat
parented2c3ca6e2bde619e57afbd6f17ccc276e02b1fd (diff)
downloadandroid-node-v8-1f2fdc9538f2ee9d9fad68137798c49113e96274.tar.gz
android-node-v8-1f2fdc9538f2ee9d9fad68137798c49113e96274.tar.bz2
android-node-v8-1f2fdc9538f2ee9d9fad68137798c49113e96274.zip
build: fix detection of Visual Studio 2017
When run in a Visual Studio 2017 command prompt the `VCINSTALLDIR` environment variable will be already set and is not cleared by the `tools/msvs/vswhere_usability_wrapper.cmd` utility when it fails to find Visual Studio 2019. This causes `vcbuild.bat` to incorrectly assume Visual Studio 2019 and generate an incompatible configuration. Clearing the value of `VCINSTALLDIR` before calling the utility fixes the detection logic. PR-URL: https://github.com/nodejs/node/pull/30119 Fixes: https://github.com/nodejs/node/issues/30118 Refs: https://github.com/nodejs/node/pull/30022 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: João Reis <reis@janeasystems.com>
Diffstat (limited to 'vcbuild.bat')
-rw-r--r--vcbuild.bat4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcbuild.bat b/vcbuild.bat
index 57f2deba79..10c9ef34bb 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -240,6 +240,10 @@ if %target_arch%==x86 if %msvs_host_arch%==x86 set vcvarsall_arg=x86
:vs-set-2019
if defined target_env if "%target_env%" NEQ "vs2019" goto vs-set-2017
echo Looking for Visual Studio 2019
+@rem VCINSTALLDIR may be set if run from a VS Command Prompt and needs to be
+@rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to
+@rem detect the version searched for
+set "VCINSTALLDIR="
call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)"
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2017
if defined msi (