summaryrefslogtreecommitdiffstats
path: root/BaseTools/get_vsvars.bat
diff options
context:
space:
mode:
authorCheng, Ching JenX <ching.jenx.cheng@intel.com>2019-09-19 16:52:26 +0800
committerLiming Gao <liming.gao@intel.com>2019-09-23 22:42:41 +0800
commit670c903a68f214463f12c0c9619c162a0f342518 (patch)
tree7239e4b3aa21748c979fc32f6ef1df11794b8b22 /BaseTools/get_vsvars.bat
parent7a25b3da78444c2400a5be6555b2735de2d4acb0 (diff)
downloadedk2-670c903a68f214463f12c0c9619c162a0f342518.tar.gz
edk2-670c903a68f214463f12c0c9619c162a0f342518.tar.bz2
edk2-670c903a68f214463f12c0c9619c162a0f342518.zip
Add VS2019 Support on ToolSetup Batches
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182 Inorder to support VS2019, we add VS2019 config process in Setup Batch Files, Because VS2019 and VS2017 could using same vswhere.exe to detect the InstallationPath, So we add the -version as the parameter of vswhere to get the correct VS2017/VS2019's InstallationPath v3: In BaseTools\set_vsprefix_envs.bat, move WINSDK10_PREFIX setting into VCToolsInstallDir check condition. Cc: Amy Chan <amy.chan@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Pete Batard <pete@akeo.ie>
Diffstat (limited to 'BaseTools/get_vsvars.bat')
-rw-r--r--BaseTools/get_vsvars.bat37
1 files changed, 30 insertions, 7 deletions
diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat
index 9f3759b2a9..3beb113be2 100644
--- a/BaseTools/get_vsvars.bat
+++ b/BaseTools/get_vsvars.bat
@@ -10,15 +10,21 @@
@echo off
set SCRIPT_ERROR=0
if "%1"=="" goto main
+if /I "%1"=="VS2019" goto VS2019Vars
if /I "%1"=="VS2017" goto VS2017Vars
if /I "%1"=="VS2015" goto VS2015Vars
if /I "%1"=="VS2013" goto VS2013Vars
if /I "%1"=="VS2012" goto VS2012Vars
:set_vsvars
-for /f "usebackq tokens=1* delims=: " %%i in (`%*`) do (
- if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
-)
+if defined VCINSTALLDIR goto :EOF
+ call %* > vswhereInfo
+ for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
+ if /i "%%i"=="installationPath" (
+ call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+ )
+ )
+ del vswhereInfo
goto :EOF
:read_vsvars
@@ -42,19 +48,36 @@ REM (Or invoke the relevant vsvars32 file beforehand).
:main
if defined VCINSTALLDIR goto :done
+ :VS2019Vars
+ if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
+ if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" (
+ call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 16,17
+ ) else (
+ call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17
+ )
+ )
+ if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
+ if exist "%ProgramFiles%\Microsoft Visual Studio\2019\BuildTools" (
+ call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 16,17
+ ) else (
+ call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17
+ )
+ )
+ if /I "%1"=="VS2019" goto ToolNotInstall
+
:VS2017Vars
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" (
- call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools
+ call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 15,16
) else (
- call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
+ call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16
)
)
if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
if exist "%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools" (
- call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools
+ call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 15,16
) else (
- call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
+ call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16
)
)
if /I "%1"=="VS2017" goto ToolNotInstall