From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.7886.1581046372483129067 for ; Thu, 06 Feb 2020 19:32:52 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: bob.c.feng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 19:32:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="379275345" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 06 Feb 2020 19:32:51 -0800 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 6 Feb 2020 19:32:51 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 7 Feb 2020 11:32:49 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Fri, 7 Feb 2020 11:32:49 +0800 From: "Bob Feng" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: Sean Brogan , "Gao, Liming" Subject: Re: [Patch 3/4] BaseTools/WindowsVsToolChain: Setup VS2017/VS2019 env Thread-Topic: [Patch 3/4] BaseTools/WindowsVsToolChain: Setup VS2017/VS2019 env Thread-Index: AQHV3UIya924Y6jgkUGRBgyltaH61KgPE/ug Date: Fri, 7 Feb 2020 03:32:49 +0000 Message-ID: <1435996bb212401a9f3c02c9045f98e0@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> <20200206230715.15564-4-michael.d.kinney@intel.com> In-Reply-To: <20200206230715.15564-4-michael.d.kinney@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Kinney, Michael D=20 Sent: Friday, February 7, 2020 7:07 AM To: devel@edk2.groups.io Cc: Sean Brogan ; Feng, Bob C ; Gao, Liming Subject: [Patch 3/4] BaseTools/WindowsVsToolChain: Setup VS2017/VS2019 env From: Sean Brogan https://bugzilla.tianocore.org/show_bug.cgi?id=3D2495 Update the WindowsVsToolChain plugin to setup the VS2017 or VS2019 developm= ent environment. This is required to build BaseTools and Structured PCD ho= st applications. Cc: Sean Brogan Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney --- .../WindowsVsToolChain/WindowsVsToolChain.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/Ba= seTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py index a8202e5992..e3c4cc94a3 100644 --- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py +++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py @@ -21,6 +21,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): =20 def do_pre_build(self, thebuilder): self.Logger =3D logging.getLogger("WindowsVsToolChain") + interesting_keys =3D ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPAT= H", "UniversalCRTSdkDir", + "UCRTVersion", "WindowsLibPath", "WindowsSdkBi= nPath", "WindowsSdkDir", "WindowsSdkVerBinPath", + "WindowsSDKVersion", "VCToolsInstallDir",=20 + "Path"] =20 # # VS2017 - Follow VS2017 where there is potential for many version= s of the tools. @@ -52,6 +55,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2017_P= REFIX", prefix) =20 + shell_env =3D shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for th= e vars that interest us. + vs_vars =3D locate_tools.QueryVcVariables( + interesting_keys, "amd64", vs_version=3D"vs2017") + for (k, v) in vs_vars.items(): + if k.upper() =3D=3D "PATH": + shell_env.insert_path(v) + else: + shell_env.set_shell_var(k, v) + # now confirm it exists if not os.path.exists(shell_environment.GetEnvironment().get_s= hell_var("VS2017_PREFIX")): self.Logger.error("Path for VS2017 toolchain is invalid") = @@ -87,6 +100,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2019_P= REFIX", prefix) =20 + shell_env =3D shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for th= e vars that interest us. + vs_vars =3D locate_tools.QueryVcVariables( + interesting_keys, "amd64", vs_version=3D"vs2019") + for (k, v) in vs_vars.items(): + if k.upper() =3D=3D "PATH": + shell_env.insert_path(v) + else: + shell_env.set_shell_var(k, v) + # now confirm it exists if not os.path.exists(shell_environment.GetEnvironment().get_s= hell_var("VS2019_PREFIX")): self.Logger.error("Path for VS2019 toolchain is invalid") -- 2.21.0.windows.1