Skip to content

Commit

Permalink
[dotnet] Ensure appropriate IL Strip value for multi-rid builds
Browse files Browse the repository at this point in the history
Using logical conjunction, ensure an appropriate value is updated
for IL Stripping in multi-rid builds.

Fixes #17115
  • Loading branch information
haritha-mohan committed Oct 2, 2024
1 parent f6501e9 commit 38e2983
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
<_RuntimeFrameworkVersion Condition="'$(CUSTOM_DOTNET_VERSION)' != ''">$(CUSTOM_DOTNET_VERSION)</_RuntimeFrameworkVersion>
</PropertyGroup>

<PropertyGroup>
<_MultiRidILStrip>true</_MultiRidILStrip>
</PropertyGroup>

<ItemGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true'">
<FrameworkReference Include="Microsoft.$(_PlatformName)" IsImplicitlyDefined="true" Pack="false" PrivateAssets="All" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,13 @@
<EnableAssemblyILStripping>false</EnableAssemblyILStripping>

<!-- Strip if we are AOT and Release -->
<EnableAssemblyILStripping Condition="'$(_RunAotCompiler)' == 'true' And '$(Configuration)' == 'Release'">true</EnableAssemblyILStripping>
<EnableAssemblyILStripping Condition="'$(_RunAotCompiler)' == 'true' And '$(Configuration)' == 'Release' And '$(_MultiRidILStrip)' == 'true'">true</EnableAssemblyILStripping>

<!-- Don't strip if we are running the interpreter -->
<EnableAssemblyILStripping Condition="'$(MtouchInterpreter)' != ''">false</EnableAssemblyILStripping>

<!-- Using logical conjunction, ensure an appropriate value is updated for IL Stripping in multi-rid builds -->
<_MultiRidILStrip>$(EnableAssemblyILStripping)</_MultiRidILStrip>
</PropertyGroup>
</Target>

Expand Down

0 comments on commit 38e2983

Please sign in to comment.