Skip to content

Commit 4c990b9

Browse files
authored
Check MSVC arm64 variant on arm64 host (#4555)
1 parent 67b35f2 commit 4c990b9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

newsfragments/4553.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added detection of ARM64 variant of MSVC -- by :user:`saschanaz`

setuptools/msvc.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from more_itertools import unique_everseen
2727

2828
import distutils.errors
29+
from distutils.util import get_platform
2930

3031
# https://github.com/python/mypy/issues/8166
3132
if not TYPE_CHECKING and platform.system() == 'Windows':
@@ -89,8 +90,9 @@ def _msvc14_find_vc2017():
8990
if not root:
9091
return None, None
9192

93+
variant = 'arm64' if get_platform() == 'win-arm64' else 'x86.x64'
9294
suitable_components = (
93-
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
95+
f"Microsoft.VisualStudio.Component.VC.Tools.{variant}",
9496
"Microsoft.VisualStudio.Workload.WDExpress",
9597
)
9698

0 commit comments

Comments
 (0)