Skip to content

Commit b12a24c

Browse files
committed
Add NativeAOT size and experimentation options
1 parent c4180b2 commit b12a24c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Tests/AuthoringTest/AuthoringTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<Platforms>x64;x86</Platforms>
66
<CsWinRTComponent>true</CsWinRTComponent>
7-
<IsTrimmable>true</IsTrimmable>
7+
<IsAotCompatible>true</IsAotCompatible>
88
<!-- CsWinRTEnableLogging helps to diagnose generation issues -->
99
<!-- <CsWinRTEnableLogging>true</CsWinRTEnableLogging> -->
1010
<!--<CsWinRTKeepGeneratedSources>true</CsWinRTKeepGeneratedSources>-->

src/Tests/AuthoringTest/Directory.Build.props

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,21 @@
1313
it we can also further validate that the self-contained authoring scenario works correctly
1414
-->
1515
<PropertyGroup Condition="'$(Configuration)' == 'Release' and '$(Platform)' == 'x64'">
16-
<IsAotCompatible>true</IsAotCompatible>
1716
<PublishAot>true</PublishAot>
17+
18+
<!-- General .NET and NativeAOT size saving options -->
19+
<UseSystemResourceKeys>true</UseSystemResourceKeys>
20+
<InvariantGlobalization>true</InvariantGlobalization>
21+
<OptimizationPreference>Size</OptimizationPreference>
22+
<StackTraceSupport>false</StackTraceSupport>
23+
24+
<!-- Unsupported size saving options, can be experimented with to investigate binary size -->
25+
<IlcFoldIdenticalMethodBodies>false</IlcFoldIdenticalMethodBodies>
26+
<IlcDisableReflection>false</IlcDisableReflection>
27+
28+
<!-- Enable generating files to inspect the binary size with sizoscope (https://github.com/MichalStrehovsky/sizoscope) -->
29+
<IlcGenerateMstatFile>true</IlcGenerateMstatFile>
30+
<IlcGenerateDgmlFile>true</IlcGenerateDgmlFile>
1831
</PropertyGroup>
1932

2033
</Project>

0 commit comments

Comments
 (0)