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>
\r
def do_pre_build(self, thebuilder):\r
self.Logger = logging.getLogger("WindowsVsToolChain")\r
\r
def do_pre_build(self, thebuilder):\r
self.Logger = logging.getLogger("WindowsVsToolChain")\r
+ interesting_keys = ["ExtensionSdkDir", "INCLUDE", "LIB", "LIBPATH", "UniversalCRTSdkDir",\r
+ "UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath",\r
+ "WindowsSDKVersion", "VCToolsInstallDir", "Path"]\r
\r
#\r
# VS2017 - Follow VS2017 where there is potential for many versions of the tools.\r
\r
#\r
# VS2017 - Follow VS2017 where there is potential for many versions of the tools.\r
prefix = prefix + os.path.sep\r
shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix)\r
\r
prefix = prefix + os.path.sep\r
shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix)\r
\r
+ shell_env = shell_environment.GetEnvironment()\r
+ # Use the tools lib to determine the correct values for the vars that interest us.\r
+ vs_vars = locate_tools.QueryVcVariables(\r
+ interesting_keys, "amd64", vs_version="vs2017")\r
+ for (k, v) in vs_vars.items():\r
+ if k.upper() == "PATH":\r
+ shell_env.insert_path(v)\r
+ else:\r
+ shell_env.set_shell_var(k, v)\r
+\r
# now confirm it exists\r
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX")):\r
self.Logger.error("Path for VS2017 toolchain is invalid")\r
# now confirm it exists\r
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX")):\r
self.Logger.error("Path for VS2017 toolchain is invalid")\r
prefix = prefix + os.path.sep\r
shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix)\r
\r
prefix = prefix + os.path.sep\r
shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix)\r
\r
+ shell_env = shell_environment.GetEnvironment()\r
+ # Use the tools lib to determine the correct values for the vars that interest us.\r
+ vs_vars = locate_tools.QueryVcVariables(\r
+ interesting_keys, "amd64", vs_version="vs2019")\r
+ for (k, v) in vs_vars.items():\r
+ if k.upper() == "PATH":\r
+ shell_env.insert_path(v)\r
+ else:\r
+ shell_env.set_shell_var(k, v)\r
+\r
# now confirm it exists\r
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX")):\r
self.Logger.error("Path for VS2019 toolchain is invalid")\r
# now confirm it exists\r
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX")):\r
self.Logger.error("Path for VS2019 toolchain is invalid")\r