Skip to content

Commit

Permalink
feat: adding support for AOT Generation
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel authored and spouliot committed Mar 4, 2024
1 parent 58e39f6 commit 772e702
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Uno.Sdk/targets/Uno.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<Import Project="Uno.Common.Wasm.targets"
Condition=" $(_IsStandaloneWasmHead) and $(UsingUnoCommonWasmTargets) == '' " />

<Import Project="Uno.GenerateAot.targets"
Condition=" $(UnoGenerateAotProfile) == 'true' AND $(IsUnoHead) == 'true' " />

<ItemGroup>
<_IgnorePlatformFiles Include="$(AndroidProjectFolder)**"
Condition=" $(IsAndroid) != 'true' " />
Expand Down
22 changes: 22 additions & 0 deletions src/Uno.Sdk/targets/Uno.GenerateAot.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project>
<PropertyGroup Condition="$(IsBrowser) == 'true'">
<WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile>
<WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled>
<UnoXamlResourcesTrimming>false</UnoXamlResourcesTrimming>
<WasmShellEnableJiterpreter>false</WasmShellEnableJiterpreter>
</PropertyGroup>

<ItemGroup Condition="$(IsBrowser) == 'true'">
<WasmShellEnableAotProfile Include="aot.profile" Condition="Exists('aot.profile')" />
<WasmShellEnableAotProfile Include="$(WasmProjectFolder)aot.profile" Condition="Exists('$(WasmProjectFolder)aot.profile')" />
</ItemGroup>

<Target Name="ValidateAotConfiguration"
BeforeTargets="CoreCompile"
Condition="$(IsBrowser) == 'true' OR $(IsAndroid) == 'true'">
<Error Condition="$(Optimize) != 'true'"
HelpLink="https://aka.platform.uno/UNOB0007"
Text="AOT compilation is only supported in Release mode. Please set the 'Optimize' property to 'true' in the project file."
ErrorCode="UNOB0007" />
</Target>
</Project>

0 comments on commit 772e702

Please sign in to comment.