xamarin-macios/tests/dotnet/ExtensionConsumer/iOS
Ivan Povazan 374e902075
NativeAOT: Enable building app extensions with NativeAOT (#20872)
### Description

This PR enables building app extensions with NativeAOT. 

App extensions are class libraries and to build them with NativeAOT we
must not specify `CustomNativeMain=true`. If we do, ILC would expect
that the input assembly has a managed Main as the module entry point.

Additionally, when building class libraries (with the absence of a
managed Main entry point), our static reference from:

2e5ef1eb1c/runtime/nativeaot-bridge.m (L39)

requires build-time symbol resolution. To avoid linking errors, we
generate an empty `__managed__Main`
in the native bootstrapping code of the app extension (e.g., in
`main.arm64.mm`).

### Testing

The unit tests have been introduced to test building app extensions with
both Mono and NativeAOT.
Executing an iOS app TodayExtension built with NativeAOT has been
verified manually on an actual device.

--- 
Fixes: https://github.com/xamarin/xamarin-macios/issues/20653
2024-07-19 08:03:49 -04:00
..
ExtensionConsumer.csproj NativeAOT: Enable building app extensions with NativeAOT (#20872) 2024-07-19 08:03:49 -04:00
ExtensionConsumer.sln NativeAOT: Enable building app extensions with NativeAOT (#20872) 2024-07-19 08:03:49 -04:00
Makefile [tests] Simplify makefiles by using shared code. (#13990) 2022-01-31 21:11:08 +01:00