Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit d36274c

Browse files
committed
Enable build on hosted arm64
This is attempt #2. The first attempt was commit 176da26. Initialize HostArch to the arch-style used in RIDs directly by converting things to lowercase. Use the HostArch for the tool runtime instead of assuming x64.
1 parent 4dae083 commit d36274c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Directory.Build.props

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
<TargetGroup Condition="'$(TargetGroup)' == ''">netcoreapp</TargetGroup>
6565
<OSGroup Condition="'$(OSGroup)' == ''">$(DefaultOSGroup)</OSGroup>
6666
<ConfigurationGroup Condition="'$(ConfigurationGroup)' == ''">Debug</ConfigurationGroup>
67-
<HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)</HostArch>
68-
<ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'Arm'">arm</ArchGroup>
69-
<ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'Arm64'">arm64</ArchGroup>
67+
<HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</HostArch>
68+
<ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'arm'">arm</ArchGroup>
69+
<ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'arm64'">arm64</ArchGroup>
7070
<ArchGroup Condition="'$(ArchGroup)' == ''">x64</ArchGroup>
7171

7272
<!-- Initialize BuildConfiguration from the individual properties if it wasn't already explicitly set -->
@@ -135,9 +135,10 @@
135135
<_runtimeOS Condition="'$(_runtimeOS)' == 'tizen.4.0.0'">linux</_runtimeOS>
136136
<_runtimeOS Condition="'$(_runtimeOS)' == 'tizen.5.0.0'">linux</_runtimeOS>
137137
<_runtimeOS Condition="'$(PortableBuild)' == 'true'">$(_portableOS)</_runtimeOS>
138-
<ToolRuntimeRID>$(_runtimeOS)-x64</ToolRuntimeRID>
138+
<ToolRuntimeRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64</ToolRuntimeRID>
139+
<ToolRuntimeRID Condition="'$(ToolRuntimeID)' == ''">$(_runtimeOS)-$(HostArch)</ToolRuntimeRID>
139140
<!-- We build linux-musl-arm on a ubuntu container, so we can't use the toolset build for alpine runtime. We need to use portable linux RID for our toolset in order to be able to use it. -->
140-
<ToolRuntimeRID Condition="'$(_runtimeOS)' == 'linux-musl' AND $(ArchGroup.StartsWith('arm')) AND !$(HostArch.StartsWith('Arm'))">linux-x64</ToolRuntimeRID>
141+
<ToolRuntimeRID Condition="'$(_runtimeOS)' == 'linux-musl' AND $(ArchGroup.StartsWith('arm')) AND !$(HostArch.StartsWith('arm'))">linux-x64</ToolRuntimeRID>
141142

142143
<!-- There are no WebAssembly tools, so treat them as Windows -->
143144
<ToolRuntimeRID Condition="'$(RuntimeOS)' == 'WebAssembly'">win-x64</ToolRuntimeRID>

0 commit comments

Comments
 (0)