Skip to content

Commit

Permalink
Default to ILC host architecture that matches OS architecture on Wind…
Browse files Browse the repository at this point in the history
…ows (#80752)

It allows compilation using msbuild.exe that is x86 by default
  • Loading branch information
jkotas authored Jan 18, 2023
1 parent e2d192a commit 7b7da67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@

<RuntimeIlcPackageName>runtime.$(OSIdentifier)-$(TargetArchitecture).Microsoft.DotNet.ILCompiler</RuntimeIlcPackageName>

<!-- Default to host that matches SDK architecture -->
<!-- Default to host that matches OS architecture on Windows. It allows compilation using msbuild.exe that is x86 by default -->
<IlcHostArch Condition="'$(OS)' == 'Windows_NT' and '$(IlcHostArch)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</IlcHostArch>
<!-- Default to host that matches SDK architecture on non-Windows -->
<IlcHostArch Condition="'$(IlcHostArch)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</IlcHostArch>
<IlcHostPackageName>runtime.$(OSIdentifier)-$(IlcHostArch).Microsoft.DotNet.ILCompiler</IlcHostPackageName>

<IlcCalledViaPackage>true</IlcCalledViaPackage>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<FullRuntimeName Condition="'$(ServerGarbageCollection)' == 'true'">libRuntime.ServerGC</FullRuntimeName>

<CrossCompileRid />
<CrossCompileRid Condition="!$(RuntimeIdentifier.EndsWith('-$(OSHostArch)'))">$(RuntimeIdentifier)</CrossCompileRid>
<CrossCompileRid Condition="!$(RuntimeIdentifier.EndsWith('-$(IlcHostArch)'))">$(RuntimeIdentifier)</CrossCompileRid>

<CrossCompileArch />
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-x64'))">x86_64</CrossCompileArch>
Expand Down

0 comments on commit 7b7da67

Please sign in to comment.