summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiyas Sait <niyas.sait@linaro.org>2021-09-27 19:52:54 (GMT)
committerGitHub <noreply@github.com>2021-09-27 19:52:54 (GMT)
commitadc5d32f474595aa16a90369393440a0bc190777 (patch)
treeb418a6e5391a52839a67da1361af1308071d48dc
parent16b5bc68964c6126845f4cdd54b24996e71ae0ba (diff)
downloadcpython-adc5d32f474595aa16a90369393440a0bc190777.zip
cpython-adc5d32f474595aa16a90369393440a0bc190777.tar.gz
cpython-adc5d32f474595aa16a90369393440a0bc190777.tar.bz2
Select correct tool platform when building on Windows ARM64 natively (GH-28491)
-rw-r--r--PCbuild/pcbuild.proj7
-rw-r--r--Tools/scripts/freeze_modules.py6
2 files changed, 9 insertions, 4 deletions
diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj
index b3cbd47..f32422a 100644
--- a/PCbuild/pcbuild.proj
+++ b/PCbuild/pcbuild.proj
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<PropertyGroup Label="Globals">
<ProjectGuid>{CC9B93A2-439D-4058-9D29-6DCF43774405}</ProjectGuid>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
@@ -15,9 +18,7 @@
<ItemDefinitionGroup>
<FreezeProjects>
- <Platform>$(Platform)</Platform>
- <Platform Condition="$(Platform) == 'ARM'">Win32</Platform>
- <Platform Condition="$(Platform) == 'ARM64'">x64</Platform>
+ <Platform>$(PreferredToolArchitecture)</Platform>
<Configuration>$(Configuration)</Configuration>
<Configuration Condition="$(Configuration) == 'PGInstrument'">Release</Configuration>
<Properties></Properties>
diff --git a/Tools/scripts/freeze_modules.py b/Tools/scripts/freeze_modules.py
index aa799d7..cfc6f79 100644
--- a/Tools/scripts/freeze_modules.py
+++ b/Tools/scripts/freeze_modules.py
@@ -8,6 +8,7 @@ import hashlib
import os
import ntpath
import posixpath
+import platform
import subprocess
import sys
import textwrap
@@ -35,7 +36,10 @@ if sys.platform != "win32":
sys.exit("ERROR: missing _freeze_module")
else:
def find_tool():
- for arch in ['amd64', 'win32']:
+ archs = ['amd64', 'win32']
+ if platform.machine() == "ARM64":
+ archs.append('arm64')
+ for arch in archs:
for exe in ['_freeze_module.exe', '_freeze_module_d.exe']:
tool = os.path.join(ROOT_DIR, 'PCbuild', arch, exe)
if os.path.isfile(tool):