According to FlaxEngine/Source/Tools/Flax.Build/Build/DotNet/DotNetAOT.cs at master · FlaxEngine/FlaxEngine (github.com)
FlaxEngine build system has already supported native AOT mode. The remaining job is to modify original hostfxr implementation by referring to mono aot implementation.
Thanks to the good design of FlaxEngine, it seems to only need to rewrite InitHostfxr
, ShutdownHostfxr
, GetStaticMethodPointer
those three fuctions in Source/Engine/Scripting/runtime/DotNet.cpp
.
And then we just need to checkout all the code that has differences between JIT and AOT mode. I believe this could be done by searching all places used USE_MONO_AOT
macros and to add our own macors to make it AOT-compatiable.
Please correct me if I’m wrong at any point.