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>
\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
\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