summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/_msvccompiler.py
diff options
context:
space:
mode:
authorPaul Monson <paulmon@users.noreply.github.com>2019-04-25 18:36:45 (GMT)
committerSteve Dower <steve.dower@python.org>2019-04-25 18:36:45 (GMT)
commit62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c (patch)
treef59fcebb25702acbde504865f1a483ab7ac80954 /Lib/distutils/_msvccompiler.py
parent8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b (diff)
downloadcpython-62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c.zip
cpython-62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c.tar.gz
cpython-62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c.tar.bz2
bpo-35920: Windows 10 ARM32 platform support (GH-11774)
Diffstat (limited to 'Lib/distutils/_msvccompiler.py')
-rw-r--r--Lib/distutils/_msvccompiler.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py
index 58b20a2..c7ac3f0 100644
--- a/Lib/distutils/_msvccompiler.py
+++ b/Lib/distutils/_msvccompiler.py
@@ -89,13 +89,24 @@ def _find_vc2017():
return None, None
+PLAT_SPEC_TO_RUNTIME = {
+ 'x86' : 'x86',
+ 'x86_amd64' : 'x64',
+ 'x86_arm' : 'arm',
+}
+
def _find_vcvarsall(plat_spec):
_, best_dir = _find_vc2017()
vcruntime = None
- vcruntime_plat = 'x64' if 'amd64' in plat_spec else 'x86'
+
+ if plat_spec in PLAT_SPEC_TO_RUNTIME:
+ vcruntime_plat = PLAT_SPEC_TO_RUNTIME[plat_spec]
+ else:
+ vcruntime_plat = 'x64' if 'amd64' in plat_spec else 'x86'
+
if best_dir:
vcredist = os.path.join(best_dir, "..", "..", "redist", "MSVC", "**",
- "Microsoft.VC141.CRT", "vcruntime140.dll")
+ vcruntime_plat, "Microsoft.VC141.CRT", "vcruntime140.dll")
try:
import glob
vcruntime = glob.glob(vcredist, recursive=True)[-1]
@@ -178,6 +189,7 @@ def _find_exe(exe, paths=None):
PLAT_TO_VCVARS = {
'win32' : 'x86',
'win-amd64' : 'x86_amd64',
+ 'win-arm32' : 'x86_arm',
}
# A set containing the DLLs that are guaranteed to be available for