From nobody Mon Dec 15 03:15:22 2025 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 1510924139105647.0062533013444; Fri, 17 Nov 2017 05:08:59 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2C1642035BB1C; Fri, 17 Nov 2017 05:04:45 -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 A22EE2035BB1C for ; Fri, 17 Nov 2017 05:04:41 -0800 (PST) Received: by mail-wm0-x22e.google.com with SMTP id 9so6321780wme.4 for ; Fri, 17 Nov 2017 05:08:52 -0800 (PST) Received: from localhost.localdomain ([84.203.87.46]) by smtp.gmail.com with ESMTPSA id b36sm2883140edd.67.2017.11.17.05.08.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 05:08:50 -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=mBtWq59SnRp4vvq3aSRHs0PMKjXad5Yn62Z1K8NqVNQ1I4Wheqmm6T/5I95MRXsOMZ f1SFUiiBC69TnEHWMKZOE9kM69XOfETf0Uh+gpAqYCnnHVdvXtUY2eQbSPMuUR8AXjOH mSJ1p2ZwoMbmolCjOpCrF4tOjxWyPJhiUbYTH+yzoa3t/YmLR3iPO1eJxRq4KCcYs0bP iclbWNoX3vEisluPxnod0Lp8jr892W+bsTbCCbkdJVehmTz6542LF+UC0WRjN08anaFk 0ntqef5zXpn+3jN6/JAJhpeY4QH0craGeiSdxY4/eUe+yRCuogv6I6aDAb5Ur3kQyZR4 A4tg== 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=LKX8Q142D4dlMInfgwO7GMo7GKUou4NIT69z3OlCAfmndnGnO9GmoqrbFZoeIUEI4t kSmlUgKLfpnWDJBe3dOTLdf81IYqyVPCVXGAI6+y7wPcetHNxe7VtTzUt8P9zAFj7vli K9Lz3UHBRW4AmR6DRF7VyPs5WiT9P3CVfvFu2DtbLR68xxcGETJHOd5xLufKj1wb0zQt Qs32XnFcscb15JppHNo2PT80Wzb9mpy5oq69PiKvhPkhL+iUEUmbAdv9EdQ3ghovpkDU RvuXFNQMxiUWX04yYAJmVoitapnG1aYwRvZ/XOohfoRRBC2VK4Pjl6FMWrqvyT+Q7w47 f83A== X-Gm-Message-State: AJaThX7KKX35Ryqn3bSJP9deIWsBeTp+oCckfymMUl4htHopAyJ77xy7 o5/T9VWuAwDaWq6ulWRHzg+7o1bl8jY= X-Google-Smtp-Source: AGs4zMblGsNpG0vq5uiO04j98/ClVCOvRZb1KVW99PA142GIM5fHEOCExCFdop1GKeR1ieZua4QSCQ== X-Received: by 10.80.158.194 with SMTP id a60mr7139707edf.228.1510924130757; Fri, 17 Nov 2017 05:08:50 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Date: Fri, 17 Nov 2017 13:08:36 +0000 Message-Id: <20171117130837.9164-4-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20171117130837.9164-1-pete@akeo.ie> References: <20171117130837.9164-1-pete@akeo.ie> Subject: [edk2] [PATCH v2 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