diff options
author | Liming Gao <liming.gao@intel.com> | 2017-11-23 00:26:09 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-11-29 16:03:12 +0800 |
commit | 7dddedc8b28134af84b189c9b455779e4cf1a2f0 (patch) | |
tree | 87ebacdaa7491a6a29e746ab2222429959b51188 /BaseTools/set_vsprefix_envs.bat | |
parent | 1d0d15522ac67393b49a5d4234654dd503975267 (diff) | |
download | edk2-7dddedc8b28134af84b189c9b455779e4cf1a2f0.zip edk2-7dddedc8b28134af84b189c9b455779e4cf1a2f0.tar.gz edk2-7dddedc8b28134af84b189c9b455779e4cf1a2f0.tar.bz2 |
BaseTools: Update VS batch file to auto detect VS2017
This way depends on VS vswhere.exe to find VS2017 installed directory.
vswhere.exe starts in Visual Studio 2017 version 15.2.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/set_vsprefix_envs.bat')
-rw-r--r-- | BaseTools/set_vsprefix_envs.bat | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.bat index b05b1d2..ed83222 100644 --- a/BaseTools/set_vsprefix_envs.bat +++ b/BaseTools/set_vsprefix_envs.bat @@ -3,7 +3,7 @@ @REM however it may be executed directly from the BaseTools project folder
@REM if the file is not executed within a WORKSPACE\BaseTools folder.
@REM
-@REM Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+@REM Copyright (c) 2016-2017, Intel Corporation. All rights reserved.<BR>
@REM
@REM This program and the accompanying materials are licensed and made available
@REM under the terms and conditions of the BSD License which accompanies this
@@ -90,6 +90,37 @@ if defined VS140COMNTOOLS ( )
)
+@REM set VS2017
+if not defined VS150COMNTOOLS (
+ if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
+ for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
+ if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+ )
+ ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
+ for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
+ if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+ )
+ ) else (
+ goto SetWinDDK
+ )
+)
+
+if defined VCToolsInstallDir (
+ if not defined VS2017_PREFIX (
+ set "VS2017_PREFIX=%VCToolsInstallDir%"
+ )
+)
+if not defined WINSDK10_PREFIX (
+ if defined WindowsSdkVerBinPath (
+ set "WINSDK10_PREFIX=%WindowsSdkVerBinPath%"
+ ) else if exist "%ProgramFiles(x86)%\Windows Kits\10\bin" (
+ set "WINSDK10_PREFIX=%ProgramFiles(x86)%\Windows Kits\10\bin\"
+ ) else if exist "%ProgramFiles%\Windows Kits\10\bin" (
+ set "WINSDK10_PREFIX=%ProgramFiles%\Windows Kits\10\bin\"
+ )
+)
+
+:SetWinDDK
if not defined WINDDK3790_PREFIX (
set WINDDK3790_PREFIX=C:\WINDDK\3790.1830\bin\
)
|