Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pylib/gyp/MSVSVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
def _SetupScriptInternal(self, target_arch):
"""Returns a command (with arguments) to be used to set up the
environment."""
assert target_arch in ("x86", "x64"), "target_arch not supported"
assert target_arch in ("x86", "x64", "arm64"), "target_arch not supported"
# If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the
# depot_tools build tools and should run SetEnv.Cmd to set up the
# environment. The check for WindowsSDKDir alone is not sufficient because
Expand All @@ -109,8 +109,10 @@
)

# Always use a native executable, cross-compiling if necessary.
host_arch = "amd64" if is_host_arch_x64 else "x86"
msvc_target_arch = "amd64" if target_arch == "x64" else "x86"
host_arch = "amd64" if is_host_arch_x64 else (
"arm64" if os.environ.get("PROCESSOR_ARCHITECTURE") == "ARM64" else "x86"

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-15-intel, 3.10)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-15-intel, 3.9)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.8)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-latest, 3.8)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (macos-15-intel, 3.8)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.10)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.11)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)

Check failure on line 113 in pylib/gyp/MSVSVersion.py

View workflow job for this annotation

GitHub Actions / Python_tests (ubuntu-latest, 3.9)

ruff (E501)

pylib/gyp/MSVSVersion.py:113:89: E501 Line too long (89 > 88)
)
msvc_target_arch = {"x64": "amd64"}.get(target_arch, target_arch)
arg = host_arch
if host_arch != msvc_target_arch:
arg += "_" + msvc_target_arch
Expand Down
3 changes: 2 additions & 1 deletion pylib/gyp/generator/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def __init__(
if flavor == "win":
# See docstring of msvs_emulation.GenerateEnvironmentFiles().
self.win_env = {}
for arch in ("x86", "x64"):
for arch in ("x86", "x64", "arm64"):
self.win_env[arch] = "environment." + arch

# Relative path from build output dir to base dir.
Expand Down Expand Up @@ -2339,6 +2339,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
master_ninja.variable("rc", "rc.exe")
master_ninja.variable("ml_x86", "ml.exe")
master_ninja.variable("ml_x64", "ml64.exe")
master_ninja.variable("ml_arm64", "armasm64.exe")
master_ninja.variable("mt", "mt.exe")
else:
master_ninja.variable("ld", CommandWithWrapper("LINK", wrappers, ld))
Expand Down
2 changes: 1 addition & 1 deletion pylib/gyp/msvs_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ def GenerateEnvironmentFiles(
meet your requirement (e.g. for custom toolchains), you can pass
"-G ninja_use_custom_environment_files" to the gyp to suppress file
generation and use custom environment files prepared by yourself."""
archs = ("x86", "x64")
archs = ("x86", "x64", "arm64")
if generator_flags.get("ninja_use_custom_environment_files", 0):
cl_paths = {}
for arch in archs:
Expand Down
Loading