Commit 3fa9efcb authored by Jason R. Coombs's avatar Jason R. Coombs

Extract generator for simpler syntax. Ref #995.

parent 9430e92f
...@@ -987,16 +987,17 @@ class EnvironmentInfo: ...@@ -987,16 +987,17 @@ class EnvironmentInfo:
""" """
Microsoft Windows SDK Tools Microsoft Windows SDK Tools
""" """
tools = [] return list(self._sdk_tools())
def _sdk_tools(self):
if self.vc_ver < 15.0: if self.vc_ver < 15.0:
bin_dir = 'Bin' if self.vc_ver <= 11.0 else r'Bin\x86' bin_dir = 'Bin' if self.vc_ver <= 11.0 else r'Bin\x86'
tools += [os.path.join(self.si.WindowsSdkDir, bin_dir)] yield os.path.join(self.si.WindowsSdkDir, bin_dir)
if not self.pi.current_is_x86(): if not self.pi.current_is_x86():
arch_subdir = self.pi.current_dir(x64=True) arch_subdir = self.pi.current_dir(x64=True)
path = 'Bin%s' % arch_subdir path = 'Bin%s' % arch_subdir
tools += [os.path.join(self.si.WindowsSdkDir, path)] yield os.path.join(self.si.WindowsSdkDir, path)
if self.vc_ver == 10.0 or self.vc_ver == 11.0: if self.vc_ver == 10.0 or self.vc_ver == 11.0:
if self.pi.target_is_x86(): if self.pi.target_is_x86():
...@@ -1004,18 +1005,16 @@ class EnvironmentInfo: ...@@ -1004,18 +1005,16 @@ class EnvironmentInfo:
else: else:
arch_subdir = self.pi.current_dir(hidex86=True, x64=True) arch_subdir = self.pi.current_dir(hidex86=True, x64=True)
path = r'Bin\NETFX 4.0 Tools%s' % arch_subdir path = r'Bin\NETFX 4.0 Tools%s' % arch_subdir
tools += [os.path.join(self.si.WindowsSdkDir, path)] yield os.path.join(self.si.WindowsSdkDir, path)
elif self.vc_ver >= 15.0: elif self.vc_ver >= 15.0:
path = os.path.join(self.si.WindowsSdkDir, 'Bin') path = os.path.join(self.si.WindowsSdkDir, 'Bin')
arch_subdir = self.pi.current_dir(x64=True) arch_subdir = self.pi.current_dir(x64=True)
sdkver = self._get_content_dirname(path, slash=False) sdkver = self._get_content_dirname(path, slash=False)
tools += [os.path.join(path, r'%s%s' % (sdkver, arch_subdir))] yield os.path.join(path, r'%s%s' % (sdkver, arch_subdir))
if self.si.WindowsSDKExecutablePath: if self.si.WindowsSDKExecutablePath:
tools += [self.si.WindowsSDKExecutablePath] yield self.si.WindowsSDKExecutablePath
return tools
@property @property
def SdkSetup(self): def SdkSetup(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment