summaryrefslogtreecommitdiff
path: root/setuptools/msvc9_support.py
diff options
context:
space:
mode:
authorJ. Goutin <JGoutin@users.noreply.github.com>2016-04-29 18:11:51 +0200
committerJ. Goutin <JGoutin@users.noreply.github.com>2016-04-29 18:11:51 +0200
commit11cd038b9bf7231b2007c8accb406062965fa8a0 (patch)
tree511bb4b822897b5970e2556c4168fe8037694a13 /setuptools/msvc9_support.py
parentce56d832ee2f6b0b7e0f934460aa435c7a128ab4 (diff)
downloadpython-setuptools-git-11cd038b9bf7231b2007c8accb406062965fa8a0.tar.gz
Tests and fixes
Tests advancement: I tested WinSDK 7.1, WinSDK 7.0, WinSDK 6.1, VC for Python 2.7 with current arch as X86 and all possible target architecture. Environment generated from script is good for all (With some little fixes in this commit), some path are add on some case, I will look if I need to remove them. I need also to check .Net Framework 64bit in this case. I need also to do test for sames compilers on X64 architecture, I will also test MSVC++ 2015 Build tools on X64. I looked for create automated test on AppVeyor for this, but it is impossible to only have one of theses compilers only installed... So I did all test manually.
Diffstat (limited to 'setuptools/msvc9_support.py')
-rw-r--r--setuptools/msvc9_support.py40
1 files changed, 29 insertions, 11 deletions
diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py
index 58e34204..94de6fd1 100644
--- a/setuptools/msvc9_support.py
+++ b/setuptools/msvc9_support.py
@@ -235,7 +235,7 @@ class PlatformInfo:
current_cpu = os.environ['processor_architecture'].lower()
def __init__(self, arch):
- self.arch = arch.lower()
+ self.arch = arch.lower().replace('x64', 'amd64')
@property
def target_cpu(self):
@@ -810,7 +810,7 @@ class EnvironmentInfo:
"""
forcex86 = True if self.vcver <= 10.0 else False
arch_subdir = self.pi.cross_dir(forcex86)
- tools = [os.path.join(self.si.VCInstallDir, 'VCPackages'),
+ tools = [os.path.join(self.si.VCInstallDir, r'VCPackages'),
os.path.join(self.si.VCInstallDir, 'Bin%s' % arch_subdir)]
if self.pi.cross_dir() and self.vcver >= 14.0:
@@ -829,7 +829,7 @@ class EnvironmentInfo:
"""
if self.vcver <= 10.0:
arch_subdir = self.pi.target_dir(hidex86=True, x64=True)
- return [os.path.join(self.si.WindowsSdkDir, 'Bin%s' % arch_subdir)]
+ return [os.path.join(self.si.WindowsSdkDir, 'Lib%s' % arch_subdir)]
else:
arch_subdir = self.pi.target_dir(x64=True)
@@ -862,7 +862,13 @@ class EnvironmentInfo:
Microsoft Windows SDK Libraries Paths
"""
ref = os.path.join(self.si.WindowsSdkDir, 'References')
- libpath = [os.path.join(ref, r'CommonConfiguration\Neutral')]
+ libpath = []
+
+ if self.vcver <= 9.0:
+ libpath += self.OSLibraries
+
+ if self.vcver >= 11.0:
+ libpath += [os.path.join(ref, r'CommonConfiguration\Neutral')]
if self.vcver >= 14.0:
libpath += [ref,
@@ -910,6 +916,9 @@ class EnvironmentInfo:
"""
Microsoft Windows SDK Setup
"""
+ if self.vcver > 9.0:
+ return []
+
return [os.path.join(self.si.WindowsSdkDir, 'Setup')]
@property
@@ -1033,27 +1042,35 @@ class EnvironmentInfo:
vcruntime = vcruntime % (arch_subdir, self.vcver, self.vcver)
return os.path.join(self.si.VCInstallDir, vcruntime)
- def return_env(self):
+ def return_env(self, exists=True):
"""
Return environment dict.
+
+ Parameters
+ ----------
+ exists: bool
+ It True, only return existing paths.
"""
env = dict(
include=self._build_paths('include',
[self.VCIncludes,
self.OSIncludes,
self.UCRTIncludes,
- self.NetFxSDKIncludes]),
+ self.NetFxSDKIncludes],
+ exists),
lib=self._build_paths('lib',
[self.VCLibraries,
self.OSLibraries,
self.FxTools,
self.UCRTLibraries,
- self.NetFxSDKLibraries]),
+ self.NetFxSDKLibraries],
+ exists),
libpath=self._build_paths('libpath',
[self.VCLibraries,
self.FxTools,
self.VCStoreRefs,
- self.OSLibpath]),
+ self.OSLibpath],
+ exists),
path=self._build_paths('path',
[self.VCTools,
self.VSTools,
@@ -1063,13 +1080,14 @@ class EnvironmentInfo:
self.FxTools,
self.MSBuild,
self.HTMLHelpWorkshop,
- self.FSharp]),
+ self.FSharp],
+ exists),
)
if self.vcver >= 14 and os.path.isfile(self.VCRuntimeRedist):
env['py_vcruntime_redist'] = self.VCRuntimeRedist
return env
- def _build_paths(self, name, spec_path_lists):
+ def _build_paths(self, name, spec_path_lists, exists):
"""
Given an environment variable name and specified paths,
return a pathsep-separated string of paths containing
@@ -1081,7 +1099,7 @@ class EnvironmentInfo:
spec_paths = itertools.chain.from_iterable(spec_path_lists)
env_paths = os.environ.get(name, '').split(os.pathsep)
paths = itertools.chain(spec_paths, env_paths)
- extant_paths = list(filter(os.path.isdir, paths))
+ extant_paths = list(filter(os.path.isdir, paths)) if exists else paths
if not extant_paths:
msg = "%s environment variable is empty" % name.upper()
raise distutils.errors.DistutilsPlatformError(msg)