Skip to content

Commit adc5d32

Browse files
authored
Select correct tool platform when building on Windows ARM64 natively (GH-28491)
1 parent 16b5bc6 commit adc5d32

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

PCbuild/pcbuild.proj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
4+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
5+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
36
<PropertyGroup Label="Globals">
47
<ProjectGuid>{CC9B93A2-439D-4058-9D29-6DCF43774405}</ProjectGuid>
58
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
@@ -15,9 +18,7 @@
1518

1619
<ItemDefinitionGroup>
1720
<FreezeProjects>
18-
<Platform>$(Platform)</Platform>
19-
<Platform Condition="$(Platform) == 'ARM'">Win32</Platform>
20-
<Platform Condition="$(Platform) == 'ARM64'">x64</Platform>
21+
<Platform>$(PreferredToolArchitecture)</Platform>
2122
<Configuration>$(Configuration)</Configuration>
2223
<Configuration Condition="$(Configuration) == 'PGInstrument'">Release</Configuration>
2324
<Properties></Properties>

Tools/scripts/freeze_modules.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import ntpath
1010
import posixpath
11+
import platform
1112
import subprocess
1213
import sys
1314
import textwrap
@@ -35,7 +36,10 @@
3536
sys.exit("ERROR: missing _freeze_module")
3637
else:
3738
def find_tool():
38-
for arch in ['amd64', 'win32']:
39+
archs = ['amd64', 'win32']
40+
if platform.machine() == "ARM64":
41+
archs.append('arm64')
42+
for arch in archs:
3943
for exe in ['_freeze_module.exe', '_freeze_module_d.exe']:
4044
tool = os.path.join(ROOT_DIR, 'PCbuild', arch, exe)
4145
if os.path.isfile(tool):

0 commit comments

Comments
 (0)