From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web09.4910.1581030437982500953 for ; Thu, 06 Feb 2020 15:07:19 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: michael.d.kinney@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 orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 15:07:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="379222370" Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga004.jf.intel.com with ESMTP; 06 Feb 2020 15:07:17 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Sean Brogan , Bob Feng , Liming Gao Subject: [Patch 3/4] BaseTools/WindowsVsToolChain: Setup VS2017/VS2019 env Date: Thu, 6 Feb 2020 15:07:14 -0800 Message-Id: <20200206230715.15564-4-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200206230715.15564-1-michael.d.kinney@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sean Brogan https://bugzilla.tianocore.org/show_bug.cgi?id=2495 Update the WindowsVsToolChain plugin to setup the VS2017 or VS2019 development environment. This is required to build BaseTools and Structured PCD host 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/BaseTools/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): def do_pre_build(self, thebuilder): self.Logger = logging.getLogger("WindowsVsToolChain") + interesting_keys = ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPATH", "UniversalCRTSdkDir", + "UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath", + "WindowsSDKVersion", "VCToolsInstallDir", "Path"] # # VS2017 - Follow VS2017 where there is potential for many versions of the tools. @@ -52,6 +55,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): prefix = prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix) + shell_env = shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for the vars that interest us. + vs_vars = locate_tools.QueryVcVariables( + interesting_keys, "amd64", vs_version="vs2017") + for (k, v) in vs_vars.items(): + if k.upper() == "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_shell_var("VS2017_PREFIX")): self.Logger.error("Path for VS2017 toolchain is invalid") @@ -87,6 +100,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): prefix = prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix) + shell_env = shell_environment.GetEnvironment() + # Use the tools lib to determine the correct values for the vars that interest us. + vs_vars = locate_tools.QueryVcVariables( + interesting_keys, "amd64", vs_version="vs2019") + for (k, v) in vs_vars.items(): + if k.upper() == "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_shell_var("VS2019_PREFIX")): self.Logger.error("Path for VS2019 toolchain is invalid") -- 2.21.0.windows.1