Skip to content

Commit

Permalink
update helloiOS to use dedup
Browse files Browse the repository at this point in the history
  • Loading branch information
kotlarmilos committed Dec 28, 2022
1 parent d4fe498 commit fa42252
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/mono/sample/iOS/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<RuntimeIdentifier>$(TargetOS.ToLower())-$(TargetArchitecture)</RuntimeIdentifier>
<DefineConstants Condition="'$(ArchiveTests)' == 'true'">$(DefineConstants);CI_TEST</DefineConstants>
<AppName>HelloiOS</AppName>
<Stats>true</Stats>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -41,6 +42,20 @@

<RemoveDir Directories="$(AppDir)" />

<!-- Dedup -->
<PropertyGroup>
<_DedupAssembly>$(MSBuildThisFileDirectory)$(PublishDir)\aot-instances.dll</_DedupAssembly>
</PropertyGroup>
<WriteLinesToFile File="$(MSBuildThisFileDirectory)$(PublishDir)/aot-instances.cs" Overwrite="true" Lines="" WriteOnlyWhenDifferent="true" />
<Csc
Sources="$(MSBuildThisFileDirectory)$(PublishDir)\aot-instances.cs"
OutputAssembly="$(_DedupAssembly)"
TargetType="library"
Deterministic="true"
References="@(ReferencePath)"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)" />

<ItemGroup>
<BundleAssemblies Condition="'$(RunAOTCompilation)' != 'true'" Include="$(MSBuildThisFileDirectory)$(PublishDir)\*.dll" />
<AotInputAssemblies Condition="'$(RunAOTCompilation)' == 'true'" Include="$(MSBuildThisFileDirectory)$(PublishDir)\*.dll">
Expand All @@ -49,6 +64,13 @@
</AotInputAssemblies>
</ItemGroup>

<ItemGroup>
<_AotInputAssemblies Include="$(_DedupAssembly)">
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
</_AotInputAssemblies>
</ItemGroup>

<PropertyGroup>
<AOTMode Condition="'$(TargetOS)' != 'MacCatalyst'">Full</AOTMode>
<AOTMode Condition="'$(TargetOS)' == 'MacCatalyst' and '$(MonoForceInterpreter)' != 'true'">Full</AOTMode>
Expand All @@ -61,6 +83,8 @@
Mode="$(AOTMode)"
OutputType="AsmOnly"
Assemblies="@(AotInputAssemblies)"
DedupAssembly="$(_DedupAssembly)"
Stats="$(Stats)"
AotModulesTablePath="$(AppDir)\modules.m"
AotModulesTableLanguage="ObjC"
OutputDir="$(PublishDir)"
Expand Down

0 comments on commit fa42252

Please sign in to comment.