diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-01-16 20:40:19 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-01-16 20:40:19 (GMT) |
commit | d8ce735e82df729f96be21f6d7bb8d014996a8cd (patch) | |
tree | d6730bc6b9b551938c6da85f15eb80dd57f96733 /Lib/distutils | |
parent | 51578c0c980ec449d6cc502d1282e79caa8463cf (diff) | |
parent | 1d329413fc403757998373dde3316c5f78f2f6fb (diff) | |
download | cpython-d8ce735e82df729f96be21f6d7bb8d014996a8cd.zip cpython-d8ce735e82df729f96be21f6d7bb8d014996a8cd.tar.gz cpython-d8ce735e82df729f96be21f6d7bb8d014996a8cd.tar.bz2 |
Issue #25850: Use cross-compilation by default for 64-bit Windows.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/_msvccompiler.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py index 10a9ffd..d0ba7d6 100644 --- a/Lib/distutils/_msvccompiler.py +++ b/Lib/distutils/_msvccompiler.py @@ -125,11 +125,11 @@ def _find_exe(exe, paths=None): return exe # A map keyed by get_platform() return values to values accepted by -# 'vcvarsall.bat'. Note a cross-compile may combine these (eg, 'x86_amd64' is -# the param to cross-compile on x86 targetting amd64.) +# 'vcvarsall.bat'. Always cross-compile from x86 to work with the +# lighter-weight MSVC installs that do not include native 64-bit tools. PLAT_TO_VCVARS = { 'win32' : 'x86', - 'win-amd64' : 'amd64', + 'win-amd64' : 'x86_amd64', } # A map keyed by get_platform() return values to the file under @@ -193,19 +193,8 @@ class MSVCCompiler(CCompiler) : raise DistutilsPlatformError("--plat-name must be one of {}" .format(tuple(PLAT_TO_VCVARS))) - # On x86, 'vcvarsall.bat amd64' creates an env that doesn't work; - # to cross compile, you use 'x86_amd64'. - # On AMD64, 'vcvarsall.bat amd64' is a native build env; to cross - # compile use 'x86' (ie, it runs the x86 compiler directly) - if plat_name == get_platform() or plat_name == 'win32': - # native build or cross-compile to win32 - plat_spec = PLAT_TO_VCVARS[plat_name] - else: - # cross compile from win32 -> some 64bit - plat_spec = '{}_{}'.format( - PLAT_TO_VCVARS[get_platform()], - PLAT_TO_VCVARS[plat_name] - ) + # Get the vcvarsall.bat spec for the requested platform. + plat_spec = PLAT_TO_VCVARS[plat_name] vc_env = _get_vc_env(plat_spec) if not vc_env: |