summaryrefslogtreecommitdiffstats
path: root/BaseTools/Plugin/WindowsVsToolChain
diff options
context:
space:
mode:
authorSean Brogan <sean.brogan@microsoft.com>2020-02-07 07:07:14 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-02-07 07:04:16 +0000
commit3b4ad37ebef1cd3635fde821b43a0edc116b256b (patch)
treef707c86d9872343ade765569af54101e25b5034c /BaseTools/Plugin/WindowsVsToolChain
parentd14feb6cb7ee2efcf07bf1326bdfa64ea9b3252a (diff)
downloadedk2-3b4ad37ebef1cd3635fde821b43a0edc116b256b.tar.gz
edk2-3b4ad37ebef1cd3635fde821b43a0edc116b256b.tar.bz2
edk2-3b4ad37ebef1cd3635fde821b43a0edc116b256b.zip
BaseTools/WindowsVsToolChain: Setup VS2017/VS2019 env
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 <sean.brogan@microsoft.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Plugin/WindowsVsToolChain')
-rw-r--r--BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
index bcb0648c85..c9279e1c75 100644
--- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
+++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
@@ -22,6 +22,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.
@@ -56,6 +59,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")
@@ -94,6 +107,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")