Skip to content

Commit

Permalink
[mono][ios] Add support for stripping during AOT compilation on iOS (#…
Browse files Browse the repository at this point in the history
…87728)

* Add support for stripping debug symbols and enabling IL stripping during AOT compilation on iOS
  • Loading branch information
kotlarmilos authored Jun 19, 2023
1 parent 919d316 commit 9e93f42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mono/msbuild/apple/build/AppleBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<UseMonoRuntime>true</UseMonoRuntime>
<UseMonoJustInterp Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' == 'true'">true</UseMonoJustInterp>

<!--<ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip>-->
<StripDebugSymbols Condition="'$(StripDebugSymbols)' == ''" >false</StripDebugSymbols>
<!-- Tracking issue: https://github.com/dotnet/runtime/issues/87740 -->
<!-- <ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip> -->

<_IsLibraryMode Condition="'$(NativeLib)' != ''">true</_IsLibraryMode>

Expand Down
1 change: 1 addition & 0 deletions src/mono/msbuild/apple/build/AppleBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
ProjectName="$(AppName)"
RuntimeComponents="$(RuntimeComponents)"
TargetOS="$(TargetOS)"
StripSymbolTable="$(StripDebugSymbols)"
ExcludeFromAppDir="@(_ExcludeFromAppDir)"
UseConsoleUITemplate="$(UseConsoleUITemplate)">
<Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
Expand Down
1 change: 1 addition & 0 deletions src/mono/sample/iOS/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>Link</TrimMode>
<Optimized Condition="'$(Configuration)' == 'Release'">true</Optimized>
<ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip>

<EnableDefaultAssembliesToBundle>true</EnableDefaultAssembliesToBundle>
<AppleGenerateAppBundle>true</AppleGenerateAppBundle>
Expand Down

0 comments on commit 9e93f42

Please sign in to comment.