]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the issue in VS prefix setting for VS2017/VS2019
authorLiming Gao <liming.gao@intel.com>
Thu, 13 Aug 2020 06:40:40 +0000 (14:40 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 14 Aug 2020 03:07:59 +0000 (03:07 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2896

When VS2017/VS2019 are both installed. VS prefix setting will
wrongly be set. VS2017_PREFIX is set to the same value of VS2019.

This patch clears VSINSTALLDIR and VCToolsVersion env, then
the different vcvars32 can set the correct VS env.

Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/set_vsprefix_envs.bat

index 38fb0eb260658bdc79445b464997324056db5a10..2627587ba32a90ed379dfc49af647a45db753e7e 100644 (file)
@@ -110,6 +110,9 @@ if /I "%1"=="VS2015" goto SetWinDDK
 \r
 :SetVS2017\r
 if not defined VS150COMNTOOLS (\r
+  @REM clear two envs so that vcvars32.bat can run successfully.\r
+  set VSINSTALLDIR=\r
+  set VCToolsVersion=\r
   if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (\r
     if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" (\r
       call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 15,16 > vswhereInfo\r
@@ -166,6 +169,9 @@ if not defined WINSDK_PATH_FOR_RC_EXE (
 \r
 :SetVS2019\r
 if not defined VS160COMNTOOLS (\r
+  @REM clear two envs so that vcvars32.bat can run successfully.\r
+  set VSINSTALLDIR=\r
+  set VCToolsVersion=\r
   if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (\r
     if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" (\r
       call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 16,17 > vswhereInfo\r