From nobody Sun Apr 28 03:58:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42719+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42719+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1561298332; cv=none; d=zoho.com; s=zohoarc; b=WVoBG0LMvJ5dhaB5uPaZ85U3q56tlWpkE57lcM8W0YWn3YEGlsqXQdF3ZLwckqKF/LmQ9DPYeJfXmBQutO4pXv6eSUfNHH84sIOGV9gOFk3Y4V/9/BlX5KCS6VHnhfBfCch8aYqlIii0QYVHI5725PHC/aLHOvJIACQtsgC4g9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561298332; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=jK2vQSM/EtkdrfSVx7MqAjQtyeOfXRsydOc571X3oeg=; b=gAfOwu8TaURQ3JDW1IEeRvk2tJU0L4KlgxFJxDQRG2m/wJ5VG8uh1G6beGT1w4fLSzC/mKfbbXXbcvYtMBN6G6zvi0cVaA2LEOs+zsY6uwnMLwfmr34ppozqDKnZ4xcIGmxWEH1ywg3Kj6gjvJ7ESoz7x0jvOPQqEA8Lkbw7rfQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42719+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1561298332853563.0601775835028; Sun, 23 Jun 2019 06:58:52 -0700 (PDT) Return-Path: X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Sun, 23 Jun 2019 06:58:52 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jun 2019 06:58:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,408,1557212400"; d="scan'208";a="166096503" X-Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.147]) by orsmga006.jf.intel.com with ESMTP; 23 Jun 2019 06:58:50 -0700 From: "Dandan Bi" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [patch 1/2] Edk2Setup: Remove nt32 related flag in bat files Date: Sun, 23 Jun 2019 21:58:31 +0800 Message-Id: <20190623135832.48300-2-dandan.bi@intel.com> In-Reply-To: <20190623135832.48300-1-dandan.bi@intel.com> References: <20190623135832.48300-1-dandan.bi@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dandan.bi@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1561298332; bh=oyZtDea+lqmyVIp5wUWbsN43VrRnXp0AzyrdAFTXUAc=; h=Cc:Date:From:Reply-To:Subject:To; b=gL4nzWUcWacBvKbWQVZCRQHTn3zyNynbDGN3WIggR6qGXTh4YXVqWQ8BpSMTjHwQZLO ROX0YihnSvKa9CGuQxjsBf7MC0JIm8VUGv2FSnNC5Zfh0fLPJY+LjMtGIH8cy/nKn8L2T Edwm8BzQ1FAHuq5ehG0FnQEU1+YWI0XKZ3k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1693 NT32Pkg has been removed, remove nt32 related flags in bat files. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Dandan Bi Reviewed-by: Bob Feng --- BaseTools/toolsetup.bat | 8 -------- edksetup.bat | 23 +---------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 23dae40..999f3b3 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -24,18 +24,10 @@ if /I "%1"=3D=3D"/help" goto Usage if /I "%1"=3D=3D"/?" goto Usage =20 =20 :loop if "%1"=3D=3D"" goto setup_workspace - if /I "%1"=3D=3D"--nt32" ( - if /I "%2" =3D=3D "X64" ( - shift - ) - @REM Ignore --nt32 flag - shift - goto loop - ) if /I "%1"=3D=3D"Reconfig" ( shift set RECONFIG=3DTRUE goto loop ) diff --git a/edksetup.bat b/edksetup.bat index 662ffc0..d607e2e 100755 --- a/edksetup.bat +++ b/edksetup.bat @@ -81,22 +81,10 @@ if exist %EDK_BASETOOLS% ( ) =20 :checkNt32Flag if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=3D%EDK_TOOLS_PATH% =20 -@REM The Nt32 Emulation Platform requires Microsoft Libraries -@REM and headers to interface with Windows. -if /I "%1"=3D=3D"--nt32" ( - if /I "%2"=3D=3D"X64" ( - shift - call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat" - ) else ( - call "%BASE_TOOLS_PATH%\get_vsvars.bat" - ) - shift -) - :checkBaseTools IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools call %EDK_TOOLS_PATH%\toolsetup.bat %* if /I "%1"=3D=3D"Reconfig" shift goto check_NASM @@ -147,20 +135,11 @@ if /I "%1"=3D=3D"Rebuild" shift if /I "%1"=3D=3D"ForceRebuild" shift if "%1"=3D=3D"" goto end =20 :Usage @echo. - @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32 [X64]]= [Reconfig] [Rebuild] [ForceRebuild]" - @echo --nt32 [X64] If a compiler tool chain is not available i= n the - @echo environment, call a script to attempt to se= t one up. - @echo This flag is only required if building the - @echo Nt32Pkg/Nt32Pkg.dsc system emulator. - @echo If the X64 argument is set, and a compiler = tool chain is - @echo not available, attempt to set up a tool cha= in that will - @echo create X64 binaries. Setting these two opti= ons have the - @echo potential side effect of changing tool chai= ns used for a - @echo rebuild. + @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Re= build] [ForceRebuild]" @echo. @echo Reconfig Reinstall target.txt, tools_def.txt and bui= ld_rule.txt. @echo Rebuild Perform incremental rebuild of BaseTools bi= naries. @echo ForceRebuild Force a full rebuild of BaseTools binaries. @echo. --=20 1.9.5.msysgit.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42719): https://edk2.groups.io/g/devel/message/42719 Mute This Topic: https://groups.io/mt/32177267/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 03:58:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+42720+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42720+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1561298339; cv=none; d=zoho.com; s=zohoarc; b=M5Q4Uod0o0cKA7eh3RNNq3ULSxbL3QmYJy1lTcI/se6CpxFopsMItuTwvCQbABv2psGYEGhO68MA1cod4FEkXM7+lyBlbraeSFNEQqdmSxEiNNCC+r+PvCwIcn7ukE7XzA+BjWocTXS7pQTUG/A/4LQz+/XS0vLdTCEa+wHGpZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561298339; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=WwRzkxmYZ6iZkhZL2KLgeiex5MLzKyR2diO71lBBsrA=; b=gzlUTsEjgBOTBL2Sm+ISttGntXqVkR79T2QxF2fDeBcI203UDTfFjmZ0WO4NoeCjeFuz7x0y1EmD8bkBwBzwrIoJa45lcKOIxsHrosusApJK36ULp8th7DmXZEiZaUNQ3ruUNdnMPG167LDniqfNp9BvfyKcGOlA4hZV5KnMl7I= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+42720+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1561298339138297.38059998809956; Sun, 23 Jun 2019 06:58:59 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Sun, 23 Jun 2019 06:58:58 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jun 2019 06:58:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,408,1557212400"; d="scan'208";a="166096515" X-Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.147]) by orsmga006.jf.intel.com with ESMTP; 23 Jun 2019 06:58:56 -0700 From: "Dandan Bi" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [patch 2/2] Edk2Setup: Support different VS tool chain setup Date: Sun, 23 Jun 2019 21:58:32 +0800 Message-Id: <20190623135832.48300-3-dandan.bi@intel.com> In-Reply-To: <20190623135832.48300-1-dandan.bi@intel.com> References: <20190623135832.48300-1-dandan.bi@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dandan.bi@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1561298338; bh=m9tVjdr2LrU19L5cF+w817gIKWRFBmotUDlmbPGe4nU=; h=Cc:Date:From:Reply-To:Subject:To; b=p/vUzmprYucuscNltr3Ly/VlnhCdDqrxho2447TMC5lotY+CwVgj6Q+CAiO8Bepv06X MT4RFuhDT7ZoG1RiPiEl5gflKyDxL7tVMX0Vc6KcsVYoi+Aq3+hbtHqYPpBiXTabo1yoa 5kjWYhJTsgCSuCbgoRczTTYILBXrgqLuQTY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1693 This patch is to update edksetup with additional option: VS2017 VS2015 VS2013 VS2012 to setup different VS environment. And will report error if the specified VS tool is not installed. For VS2017, also consider the case that only VS2017 build tool is installed. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Dandan Bi Reviewed-by: Bob Feng --- BaseTools/get_vsvars.bat | 42 ++++++++++++++++++++++++----- BaseTools/set_vsprefix_envs.bat | 47 ++++++++++++++++++++++++++++---- BaseTools/toolsetup.bat | 60 +++++++++++++++++++++++++++++++++++++= +--- edksetup.bat | 11 +++++++- 4 files changed, 145 insertions(+), 15 deletions(-) diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat index 9b5e9d2..9f3759b 100644 --- a/BaseTools/get_vsvars.bat +++ b/BaseTools/get_vsvars.bat @@ -6,11 +6,16 @@ @REM SPDX-License-Identifier: BSD-2-Clause-Patent @REM =20 =20 @echo off -goto :main +set SCRIPT_ERROR=3D0 +if "%1"=3D=3D"" goto main +if /I "%1"=3D=3D"VS2017" goto VS2017Vars +if /I "%1"=3D=3D"VS2015" goto VS2015Vars +if /I "%1"=3D=3D"VS2013" goto VS2013Vars +if /I "%1"=3D=3D"VS2012" goto VS2012Vars =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" ) @@ -24,22 +29,47 @@ if defined VCINSTALLDIR goto :EOF if exist "%GET_VSVARS_BAT_CHECK_DIR%\vsvars32.bat" call "%GET_VSVARS_B= AT_CHECK_DIR%\vsvars32.bat" :vsvars_done goto :EOF =20 =20 +:ToolNotInstall +set SCRIPT_ERROR=3D1 +goto :EOF + REM NOTE: This file will find the most recent Visual Studio installation REM apparent from the environment. REM To use an older version, modify your environment set up. REM (Or invoke the relevant vsvars32 file beforehand). =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%" + :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\Instal= ler\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools + ) else ( + call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Instal= ler\vswhere.exe" + ) + ) + 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\v= swhere.exe" -products Microsoft.VisualStudio.Product.BuildTools + ) else ( + call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\v= swhere.exe" + ) + ) + if /I "%1"=3D=3D"VS2017" goto ToolNotInstall + + :VS2015Vars + if defined VS140COMNTOOLS (call :read_vsvars "%VS140COMNTOOLS%") else (= if /I "%1"=3D=3D"VS2015" goto ToolNotInstall) + + :VS2013Vars + if defined VS120COMNTOOLS ( call :read_vsvars "%VS120COMNTOOLS%") else = (if /I "%1"=3D=3D"VS2013" goto ToolNotInstall) + + :VS2012Vars + if defined VS110COMNTOOLS (call :read_vsvars "%VS110COMNTOOLS%") else (= if /I "%1"=3D=3D"VS2012" goto ToolNotInstall) + if defined VS100COMNTOOLS call :read_vsvars "%VS100COMNTOOLS%" if defined VS90COMNTOOLS call :read_vsvars "%VS90COMNTOOLS%" if defined VS80COMNTOOLS call :read_vsvars "%VS80COMNTOOLS%" if defined VS71COMNTOOLS call :read_vsvars "%VS71COMNTOOLS%" =20 diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.= bat index 95f30f7..81686f5 100644 --- a/BaseTools/set_vsprefix_envs.bat +++ b/BaseTools/set_vsprefix_envs.bat @@ -8,10 +8,22 @@ @REM SPDX-License-Identifier: BSD-2-Clause-Patent @REM =20 @echo off pushd . +set SCRIPT_ERROR=3D0 +goto main + +:ToolNotInstall +set SCRIPT_ERROR=3D1 +goto :EOF + +:main +if /I "%1"=3D=3D"VS2017" goto SetVS2017 +if /I "%1"=3D=3D"VS2015" goto SetVS2015 +if /I "%1"=3D=3D"VS2013" goto SetVS2013 +if /I "%1"=3D=3D"VS2012" goto SetVS2012 =20 if defined VS71COMNTOOLS ( if not defined VS2003_PREFIX ( set "VS2003_PREFIX=3D%VS71COMNTOOLS:~0,-14%" ) @@ -45,57 +57,82 @@ if defined VS100COMNTOOLS ( if not defined WINSDK7x86_PREFIX ( set "WINSDK7x86_PREFIX=3Dc:\Program Files (x86)\Microsoft SDKs\Windows= \v7.0A\Bin\" ) ) =20 +:SetVS2012 if defined VS110COMNTOOLS ( if not defined VS2012_PREFIX ( set "VS2012_PREFIX=3D%VS110COMNTOOLS:~0,-14%" ) if not defined WINSDK71_PREFIX ( set "WINSDK71_PREFIX=3Dc:\Program Files\Microsoft SDKs\Windows\v7.1A\B= in\" ) if not defined WINSDK71x86_PREFIX ( set "WINSDK71x86_PREFIX=3Dc:\Program Files (x86)\Microsoft SDKs\Window= s\v7.1A\Bin\" ) +) else ( + if /I "%1"=3D=3D"VS2012" goto ToolNotInstall ) +if /I "%1"=3D=3D"VS2012" goto SetWinDDK =20 +:SetVS2013 if defined VS120COMNTOOLS ( if not defined VS2013_PREFIX ( set "VS2013_PREFIX=3D%VS120COMNTOOLS:~0,-14%" ) if not defined WINSDK8_PREFIX ( set "WINSDK8_PREFIX=3Dc:\Program Files\Windows Kits\8.0\bin\" ) if not defined WINSDK8x86_PREFIX ( set "WINSDK8x86_PREFIX=3Dc:\Program Files (x86)\Windows Kits\8.0\bin\" ) +) else ( + if /I "%1"=3D=3D"VS2013" goto ToolNotInstall ) +if /I "%1"=3D=3D"VS2013" goto SetWinDDK =20 +:SetVS2015 if defined VS140COMNTOOLS ( if not defined VS2015_PREFIX ( set "VS2015_PREFIX=3D%VS140COMNTOOLS:~0,-14%" ) if not defined WINSDK81_PREFIX ( set "WINSDK81_PREFIX=3Dc:\Program Files\Windows Kits\8.1\bin\" ) if not defined WINSDK81x86_PREFIX ( set "WINSDK81x86_PREFIX=3Dc:\Program Files (x86)\Windows Kits\8.1\bin\" ) +) else ( + if /I "%1"=3D=3D"VS2015" goto ToolNotInstall ) +if /I "%1"=3D=3D"VS2015" goto SetWinDDK =20 -@REM set VS2017 +:SetVS2017 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" + if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools"= ( + for /f "usebackq tokens=3D1* delims=3D: " %%i in (`"%ProgramFiles(x8= 6)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.Visu= alStudio.Product.BuildTools`) do ( + if /i "%%i"=3D=3D"installationPath" call "%%j\VC\Auxiliary\Build\v= cvars32.bat" + ) + ) else ( + for /f "usebackq tokens=3D1* delims=3D: " %%i in (`"%ProgramFiles(x8= 6)%\Microsoft Visual Studio\Installer\vswhere.exe"`) do ( + if /i "%%i"=3D=3D"installationPath" call "%%j\VC\Auxiliary\Build\v= cvars32.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" + if exist "%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools" ( + for /f "usebackq tokens=3D1* delims=3D: " %%i in (`"%ProgramFiles%\M= icrosoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStu= dio.Product.BuildTools`) do ( + if /i "%%i"=3D=3D"installationPath" call "%%j\VC\Auxiliary\Build\v= cvars32.bat" + ) + ) else ( + for /f "usebackq tokens=3D1* delims=3D: " %%i in (`"%ProgramFiles%\M= icrosoft Visual Studio\Installer\vswhere.exe"`) do ( + if /i "%%i"=3D=3D"installationPath" call "%%j\VC\Auxiliary\Build\v= cvars32.bat" + ) ) ) else ( + if /I "%1"=3D=3D"VS2017" goto ToolNotInstall goto SetWinDDK ) ) =20 if defined VCToolsInstallDir ( diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 999f3b3..395694f 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -9,10 +9,11 @@ @REM SPDX-License-Identifier: BSD-2-Clause-Patent @REM =20 @echo off pushd . +set SCRIPT_ERROR=3D0 =20 @REM ############################################################## @REM # You should not have to modify anything below this line @REM # =20 @@ -39,10 +40,34 @@ if /I "%1"=3D=3D"/?" goto Usage if /I "%1"=3D=3D"ForceRebuild" ( shift set FORCE_REBUILD=3DTRUE goto loop ) + if /I "%1"=3D=3D"VS2017" ( + shift + set VS2017=3DTRUE + set VSTool=3DVS2017 + goto loop + ) + if /I "%1"=3D=3D"VS2015" ( + shift + set VS2015=3DTRUE + set VSTool=3DVS2015 + goto loop + ) + if /I "%1"=3D=3D"VS2013" ( + shift + set VS2013=3DTRUE + set VSTool=3DVS2013 + goto loop + ) + if /I "%1"=3D=3D"VS2012" ( + shift + set VS2012=3DTRUE + set VSTool=3DVS2012 + goto loop + ) if "%1"=3D=3D"" goto setup_workspace if exist %1 ( if not defined BASE_TOOLS_PATH ( if exist %1\Source set BASE_TOOLS_PATH=3D%1 shift @@ -149,11 +174,31 @@ IF NOT exist "%EDK_TOOLS_PATH%\set_vsprefix_envs.bat"= ( @echo. @echo !!! ERROR !!! The set_vsprefix_envs.bat was not found !!! @echo. goto end ) -call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat +if defined VS2017 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2017 +) else if defined VS2015 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2015 + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2015 +) else if defined VS2013 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2013 + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2013 +) else if defined VS2012 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2012 + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2012 +) else ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat + call %EDK_TOOLS_PATH%\get_vsvars.bat +) +if %SCRIPT_ERROR% NEQ 0 ( + @echo. + @echo !!! ERROR !!! %VSTool% is not installed !!! + @echo. + goto end +) =20 if not defined CONF_PATH ( set CONF_PATH=3D%WORKSPACE%\Conf ) =20 @@ -363,11 +408,11 @@ goto end if not defined FORCE_REBUILD ( if not defined REBUILD ( goto end ) ) - call "%EDK_TOOLS_PATH%\get_vsvars.bat" + if not defined VCINSTALLDIR ( @echo. @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C to= ols !!! @echo. goto end @@ -397,22 +442,31 @@ goto end echo. goto end =20 :Usage @echo. - echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | For= ceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]" + echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | For= ceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2017] [VS2015]= [VS2013] [VS2012]" @echo. @echo base_tools_path BaseTools project path, BASE_TOOLS_PATH = will be set to this path. @echo edk_tools_path EDK_TOOLS_PATH will be set to this path. @echo Rebuild If sources are available perform an Incr= emental build, only @echo build those updated tools. @echo ForceRebuild If sources are available, rebuild all to= ols regardless of @echo whether they have been updated or not. @echo Reconfig Reinstall target.txt, tools_def.txt and = build_rule.txt. + @echo VS2012 Set the env for VS2012 build. + @echo VS2013 Set the env for VS2013 build. + @echo VS2015 Set the env for VS2015 build. + @echo VS2017 Set the env for VS2017 build. @echo. =20 :end set REBUILD=3D set FORCE_REBUILD=3D set RECONFIG=3D +set VS2017=3D +set VS2015=3D +set VS2013=3D +set VS2012=3D +set VSTool=3D popd =20 diff --git a/edksetup.bat b/edksetup.bat index d607e2e..ed46945 100755 --- a/edksetup.bat +++ b/edksetup.bat @@ -131,19 +131,28 @@ if defined CYGWIN_HOME ( ) =20 :cygwin_done if /I "%1"=3D=3D"Rebuild" shift if /I "%1"=3D=3D"ForceRebuild" shift +if /I "%1"=3D=3D"VS2017" shift +if /I "%1"=3D=3D"VS2015" shift +if /I "%1"=3D=3D"VS2013" shift +if /I "%1"=3D=3D"VS2012" shift if "%1"=3D=3D"" goto end =20 :Usage @echo. - @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Re= build] [ForceRebuild]" + @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Re= build] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012]" @echo. @echo Reconfig Reinstall target.txt, tools_def.txt and bui= ld_rule.txt. @echo Rebuild Perform incremental rebuild of BaseTools bi= naries. @echo ForceRebuild Force a full rebuild of BaseTools binaries. + @echo ForceRebuild Force a full rebuild of BaseTools binaries. + @echo VS2012 Set the env for VS2012 build. + @echo VS2013 Set the env for VS2013 build. + @echo VS2015 Set the env for VS2015 build. + @echo VS2017 Set the env for VS2017 build. @echo. @echo Note that target.template, tools_def.template and build_rules.tem= plate @echo will only be copied to target.txt, tools_def.txt and build_rule.t= xt @echo respectively if they do not exist. Use option [Reconfig] to force= the copy. @echo. --=20 1.9.5.msysgit.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42720): https://edk2.groups.io/g/devel/message/42720 Mute This Topic: https://groups.io/mt/32177268/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-