From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::22e; helo=mail-wm0-x22e.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C8B55220C161C for ; Wed, 22 Nov 2017 08:22:08 -0800 (PST) Received: by mail-wm0-x22e.google.com with SMTP id b189so11362853wmd.5 for ; Wed, 22 Nov 2017 08:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QUlzUwpajFhBvyPHnNGmlJGjDJedaUnwisR1HTO3Wcc=; b=FbTCyY+7NZAywgktRzCxONALEGIRVjxvOaqdQEg23fzjLVhJrXCNsEuOEa7OhlCPEw SEOp+trTnkJLtX3oV837UL2XM0QcN46b6YTvA37QSxONo66PEuPF3nbdCOegaTpUj0IZ WiMRrolINSsQ/N/Z5E5zwVEUhpDvMFGvZMz0tT+YtPYmkPkxhrEHo6R5flw8OT95kVQs XVk7QVOvkDI/P8d99xhi+f83gEw5lTnuXOL5lUEzqE8d4WBeK9Edm4yo1ctKxUDwcj3j Uqu5QnURArub4rEijsWhRP3jojcxiiIKXWFvUidLK23+THIPM8nrN/e1VxhAP/XWtk+w RNuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QUlzUwpajFhBvyPHnNGmlJGjDJedaUnwisR1HTO3Wcc=; b=RABGgwLgzuEElWc5hRZNUybSNNE3VyIXwnXS2d9utEmrvzflnEcXx22bTcPCn9njWt 0wKtkdtDE47Oeb3P+Hh+p8h17EElRIckLOt20Y5tiFZYVsoNqhPV5Iz9WRfaWSt1hhl1 VfXSoufF/OxDRbOpEAnvuZGoTVHCnBfU/hOPFyagbjBgWZgSmrbKs1fMQc/L5c9pZ7Pj vMROrEUAaRHdrR+S5z1b39WqCWRBe0z/0trvqLCBjhoG6uXRi70QJLGsUG7pgZasm/iq GOXWMtC3KiiaoprhxcNfvbhS4zNaoZesVHbgQhPlih5Cu6RdEiir4xoxD9eW5ZBY/eAP UV1A== X-Gm-Message-State: AJaThX7mCBjHZa37afgOyovjKZEOQ5lF+bd37H6F8/sUssqhggrpsFFE RTYf10SRDWarGtnBCykI6L6PGMeY/kM= X-Google-Smtp-Source: AGs4zMajazhuiAiSJFmqqIU/gRbi5/EKVymY5aqcyb2M7Ff1DADg+LV9zsxBP5CEVFZCaUKO7Pak5g== X-Received: by 10.80.172.29 with SMTP id v29mr29737402edc.143.1511367983590; Wed, 22 Nov 2017 08:26:23 -0800 (PST) Received: from localhost.localdomain ([84.203.50.151]) by smtp.gmail.com with ESMTPSA id d12sm9584413edh.40.2017.11.22.08.26.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Nov 2017 08:26:22 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Cc: liming.gao@intel.com Date: Wed, 22 Nov 2017 16:26:09 +0000 Message-Id: <20171122162610.4748-4-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20171122162610.4748-1-pete@akeo.ie> References: <20171122162610.4748-1-pete@akeo.ie> Subject: [PATCH v3 3/4] BaseTools: Update VS batch file to auto detect VS2017 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 16:22:09 -0000 From: Liming Gao 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 Signed-off-by: Pete Batard --- BaseTools/get_vsvars.bat | 8 +++++ BaseTools/set_vsprefix_envs.bat | 33 +++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat index 7649e1dccf47..ba3e54d588cf 100644 --- a/BaseTools/get_vsvars.bat +++ b/BaseTools/get_vsvars.bat @@ -16,6 +16,12 @@ @echo off goto :main +:set_vsvars +for /f "usebackq tokens=1* delims=: " %%i in (`%*`) do ( + if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat" +) +goto :EOF + :read_vsvars @rem Do nothing if already found, otherwise call vsvars32.bat if there if defined VCINSTALLDIR goto :EOF @@ -33,6 +39,8 @@ REM (Or invoke the relevant vsvars32 file beforehand). :main if defined VCINSTALLDIR goto :done + if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" + if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" if defined VS140COMNTOOLS call :read_vsvars "%VS140COMNTOOLS%" if defined VS120COMNTOOLS call :read_vsvars "%VS120COMNTOOLS%" if defined VS110COMNTOOLS call :read_vsvars "%VS110COMNTOOLS%" diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.bat index b05b1d222083..ed83222a24c8 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.
+@REM Copyright (c) 2016-2017, Intel Corporation. All rights reserved.
@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\ ) -- 2.9.3.windows.2