From nobody Wed Dec 25 03:04:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511367992116866.611955796412; Wed, 22 Nov 2017 08:26:32 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EB44B220C162E; Wed, 22 Nov 2017 08:22:09 -0800 (PST) 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) 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) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; 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 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) From: Pete Batard To: edk2-devel@lists.01.org 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: [edk2] [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: , Cc: liming.gao@intel.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 =20 +:set_vsvars +for /f "usebackq tokens=3D1* delims=3D: " %%i in (`%*`) do ( + if /i "%%i"=3D=3D"installationPath" call "%%j\VC\Auxiliary\Build\vcvars3= 2.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 beforehan= d). =20 :main if defined VCINSTALLDIR goto :done + if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.= exe" call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Install= er\vswhere.exe" + if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" = call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vs= where.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 fold= er @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 ava= ilable @REM under the terms and conditions of the BSD License which accompanies t= his @@ -90,6 +90,37 @@ if defined VS140COMNTOOLS ( ) ) =20 +@REM set VS2017 +if not defined VS150COMNTOOLS ( + if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.= exe" ( + for /f "usebackq tokens=3D1* delims=3D: " %%i in (`"%ProgramFiles(x86)= %\Microsoft Visual Studio\Installer\vswhere.exe"`) do ( + if /i "%%i"=3D=3D"installationPath" call "%%j\VC\Auxiliary\Build\vcv= ars32.bat" + ) + ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswher= e.exe" ( + for /f "usebackq tokens=3D1* delims=3D: " %%i in (`"%ProgramFiles%\Mic= rosoft Visual Studio\Installer\vswhere.exe"`) do ( + if /i "%%i"=3D=3D"installationPath" call "%%j\VC\Auxiliary\Build\vcv= ars32.bat" + ) + ) else ( + goto SetWinDDK + ) +) + +if defined VCToolsInstallDir ( + if not defined VS2017_PREFIX ( + set "VS2017_PREFIX=3D%VCToolsInstallDir%" + ) +) +if not defined WINSDK10_PREFIX ( + if defined WindowsSdkVerBinPath ( + set "WINSDK10_PREFIX=3D%WindowsSdkVerBinPath%" + ) else if exist "%ProgramFiles(x86)%\Windows Kits\10\bin" ( + set "WINSDK10_PREFIX=3D%ProgramFiles(x86)%\Windows Kits\10\bin\" + ) else if exist "%ProgramFiles%\Windows Kits\10\bin" ( + set "WINSDK10_PREFIX=3D%ProgramFiles%\Windows Kits\10\bin\" + ) +) + +:SetWinDDK if not defined WINDDK3790_PREFIX ( set WINDDK3790_PREFIX=3DC:\WINDDK\3790.1830\bin\ ) --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel