Skip to content

Commit

Permalink
[dotnet] Adjust ILC's build dependencies to cope with the fact that I…
Browse files Browse the repository at this point in the history
…LC doesn't support executing after ILLink.

Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However,
we need to execute both, and in order to do that, we force our own logic to execute
to determine what ILC does.

This might be improved in the future. Ref: dotnet/runtime#87187.
  • Loading branch information
rolfbjarne committed Jun 21, 2023
1 parent b36db05 commit 00b2865
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@
</_ComputeLinkerArgumentsDependsOn>
</PropertyGroup>

<PropertyGroup Condition="'$(PublishAot)' == 'true'">
<IlcCompileDependsOn>Compile;_ComputeLinkerArguments;_ComputeManagedAssemblyToLink;SetupOSSpecificProps;PrepareForILLink;_XamarinComputeIlcCompileInputs</IlcCompileDependsOn>
</PropertyGroup>

<Target Name="_ComputeLinkerFeatures">
<PropertyGroup Condition="'$(PublishAot)' == 'true'">
<!-- The one and only registrar is 'managed-static' when using NativeAOT -->
Expand Down Expand Up @@ -1166,6 +1170,13 @@
</ItemGroup>
</Target>

<Target Name="_XamarinComputeIlcCompileInputs">
<PropertyGroup>
<!-- Ask ILC to produce a static library -->
<NativeLib>static</NativeLib>
</PropertyGroup>
</Target>

<PropertyGroup>
<_GenerateBindingsDependsOn>
_ComputeBindingVariables;
Expand Down

0 comments on commit 00b2865

Please # to comment.