Skip to content

Commit

Permalink
[NativeAOT] Support library mode with NativeAOT on iOS-like platforms (
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpovazan authored and tmds committed Jan 23, 2024
1 parent e478823 commit 9eca186
Show file tree
Hide file tree
Showing 19 changed files with 284 additions and 63 deletions.
3 changes: 2 additions & 1 deletion eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
</PropertyGroup>

<PropertyGroup Condition="'$(BuildTestsOnHelix)' == 'true'">
<_AOTBuildCommand>export PATH=$HELIX_CORRELATION_PAYLOAD/build/cmake/cmake-3.16.4-Darwin-x86_64/CMake.app/Contents/bin:$PATH &amp;&amp; </_AOTBuildCommand>
<_AOTBuildCommand>export PATH=$HELIX_CORRELATION_PAYLOAD/build/cmake/cmake-3.28.0-macos-universal/CMake.app/Contents/bin:$PATH &amp;&amp; </_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) dotnet msbuild publish/ProxyProjectForAOTOnHelix.proj /bl:$XHARNESS_OUT/AOTBuild.binlog</_AOTBuildCommand>

<!-- running aot-helix tests locally, so we can test with the same project file as CI -->
<_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration)</_AOTBuildCommand>
<!-- The command below sets default properties for runtime and library tests -->
<_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR=&quot;$XHARNESS_EXECUTION_DIR&quot; /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=true /p:Configuration=$(Configuration)</_AOTBuildCommand>
<_AOTBuildCommand Condition="'$(NativeLib)' != ''">$(_AOTBuildCommand) /p:NativeLib=$(NativeLib) /p:BundlesResources=$(BundlesResources) /p:ForceLibraryModeGenerateAppBundle=$(ForceLibraryModeGenerateAppBundle)</_AOTBuildCommand>
<_AOTBuildCommand>$(_AOTBuildCommand) </_AOTBuildCommand>

<_ResetSimulatorSwitch Condition="('$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvossimulator') and '$(IncludesTestRunner)' == 'true'">--reset-simulator</_ResetSimulatorSwitch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
<_symbolExt Condition="'$(OS)' != 'Windows_NT'">$(NativeBinaryExt)$(NativeSymbolExt)</_symbolExt>
<_symbolSourcePath>$(NativeOutputPath)$(TargetName)$(_symbolExt)</_symbolSourcePath>
<_symbolTargetPath>$(PublishDir)\$(TargetName)$(_symbolExt)</_symbolTargetPath>
<!-- If the symbol is a dsym bundle, it's a folder not a file. -->
<_symbolIsFile Condition="'$(NativeSymbolExt)' == '.dsym'">false</_symbolIsFile>
<!-- If the symbol is a dSYM bundle, it's a folder not a file. -->
<_symbolIsFile Condition="'$(NativeSymbolExt)' == '.dSYM'">false</_symbolIsFile>
<_symbolIsFile Condition="'$(_symbolIsFile)' == ''">true</_symbolIsFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<FullRuntimeName Condition="'$(ServerGarbageCollection)' == 'true'">libRuntime.ServerGC</FullRuntimeName>

<CrossCompileRid />
<CrossCompileRid Condition="$(_hostOS) != $(_originalTargetOS) or !$(RuntimeIdentifier.EndsWith('-$(_hostArchitecture)'))">$(RuntimeIdentifier)</CrossCompileRid>
<CrossCompileRid Condition="'$(_hostOS)' != '$(_originalTargetOS)' or '$(_hostArchitecture)' != '$(_targetArchitecture)'">$(RuntimeIdentifier)</CrossCompileRid>

<CrossCompileArch />
<CrossCompileArch Condition="$(CrossCompileRid.EndsWith('-x64'))">x86_64</CrossCompileArch>
Expand All @@ -57,6 +57,48 @@ The .NET Foundation licenses this file to you under the MIT license.
<StandaloneGCSupportName Condition="'$(IlcStandaloneGCSupport)' == 'true'">libstandalonegc-enabled</StandaloneGCSupportName>
</PropertyGroup>

<PropertyGroup Condition="'$(_IsiOSLikePlatform)' == 'true'">
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst' and '$(_targetArchitecture)' == 'x64'">13.5</AppleMinOSVersion>
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst'">14.2</AppleMinOSVersion>
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos')))">11.0</AppleMinOSVersion>

<_AppleSdkName Condition="'$(_targetOS)' == 'ios'">iphoneos</_AppleSdkName>
<_AppleSdkName Condition="'$(_targetOS)' == 'iossimulator'">iphonesimulator</_AppleSdkName>
<_AppleSdkName Condition="'$(_targetOS)' == 'tvos'">appletvos</_AppleSdkName>
<_AppleSdkName Condition="'$(_targetOS)' == 'tvossimulator'">appletvsimulator</_AppleSdkName>
<_AppleSdkName Condition="'$(_targetOS)' == 'maccatalyst'">macosx</_AppleSdkName>

<_AppleTripleOS Condition="'$(_targetOS)' == 'maccatalyst' or $(_targetOS.StartsWith('ios'))">ios</_AppleTripleOS>
<_AppleTripleOS Condition="$(_targetOS.StartsWith('tvos'))">tvos</_AppleTripleOS>

<_AppleTripleAbi Condition="'$(_targetOS)' == 'ios' or '$(_targetOS)' == 'tvos'">macho</_AppleTripleAbi>
<_AppleTripleAbi Condition="'$(_targetOS)' == 'maccatalyst'">macabi</_AppleTripleAbi>
<_AppleTripleAbi Condition="$(_targetOS.EndsWith('simulator'))">simulator</_AppleTripleAbi>

<TargetTriple>$(CrossCompileArch)-apple-$(_AppleTripleOS)$(AppleMinOSVersion)-$(_AppleTripleAbi)</TargetTriple>
<SharedLibraryInstallName Condition="'$(SharedLibraryInstallName)' == '' and '$(NativeLib)' == 'Shared'">@rpath/$(TargetName)$(NativeBinaryExt)</SharedLibraryInstallName>
</PropertyGroup>

<Error Condition="'$(_IsiOSLikePlatform)' == 'true' and ('$(_AppleSdkName)' == '' or '$(CrossCompileArch)' == '' or '$(_AppleTripleOS)' == '' or '$(AppleMinOSVersion)' == '' or '$(_AppleTripleAbi)' == '')"
Text="One of the required Apple SDK properties is empty and was not properly resolved: _AppleSdkName = '$(_AppleSdkName)' CrossCompileArch = '$(CrossCompileArch)' _AppleTripleOS = '$(_AppleTripleOS)' AppleMinOSVersion = '$(AppleMinOSVersion)' _AppleTripleAbi = '$(_AppleTripleAbi)'" />

<PropertyGroup Condition="'$(_IsiOSLikePlatform)' == 'true'">
<Xcrun Condition="'$(Xcrun)' == ''">xcrun</Xcrun>
<_WhereXcrun>0</_WhereXcrun>
</PropertyGroup>

<Exec Command="command -v &quot;$(Xcrun)&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(_IsiOSLikePlatform)' == 'true'">
<Output TaskParameter="ExitCode" PropertyName="_WhereXcrun" />
</Exec>
<Error Condition="'$(_WhereXcrun)' != '0' and '$(_IsiOSLikePlatform)' == 'true'"
Text="'$(Xcrun)' not found in PATH. Make sure '$(Xcrun)' is available in PATH." />

<Exec Command="&quot;$(Xcrun)&quot; --sdk $(_AppleSdkName) --show-sdk-path" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(SysRoot)' == '' and '$(_IsiOSLikePlatform)' == 'true'" ConsoleToMsBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="SysRoot" />
</Exec>
<Error Condition="!Exists('$(SysRoot)') and '$(_IsiOSLikePlatform)' == 'true'"
Text="Apple SDK was not found in: '$(SysRoot)'" />

<ItemGroup>
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" />
<NativeLibrary Condition="'$(NativeLib)' == '' and '$(CustomNativeMain)' != 'true'" Include="$(IlcSdkPath)libbootstrapper.o" />
Expand Down Expand Up @@ -130,13 +172,15 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerArg Include="-gz=zlib" Condition="'$(CompressSymbols)' != 'false'" />
<LinkerArg Include="-fuse-ld=$(LinkerFlavor)" Condition="'$(LinkerFlavor)' != ''" />
<LinkerArg Include="@(NativeLibrary)" />
<LinkerArg Include="--sysroot=$(SysRoot)" Condition="'$(SysRoot)' != ''" />
<LinkerArg Include="--target=$(TargetTriple)" Condition="'$(_IsApplePlatform)' != 'true' and '$(TargetTriple)' != ''" />
<LinkerArg Include="--sysroot=&quot;$(SysRoot)&quot;" Condition="'$(SysRoot)' != '' and '$(_IsApplePlatform)' != 'true'" />
<LinkerArg Include="-isysroot &quot;$(SysRoot)&quot;" Condition="'$(SysRoot)' != '' and '$(_IsApplePlatform)' == 'true'" />
<LinkerArg Include="--target=$(TargetTriple)" Condition="'$(_targetOS)' != 'osx' and '$(TargetTriple)' != ''" />
<LinkerArg Include="-arch $(CrossCompileArch)" Condition="'$(_IsApplePlatform)' == 'true' and '$(CrossCompileArch)' != ''" />
<LinkerArg Include="-g" Condition="$(NativeDebugSymbols) == 'true'" />
<LinkerArg Include="-Wl,--strip-debug" Condition="$(NativeDebugSymbols) != 'true' and '$(_IsApplePlatform)' != 'true'" />
<LinkerArg Include="-Wl,-rpath,'$(IlcRPath)'" Condition="'$(StaticExecutable)' != 'true' and !$([MSBuild]::IsOSPlatform('Windows'))" />
<LinkerArg Include="-Wl,-rpath,&quot;$(IlcRPath)&quot;" Condition="'$(StaticExecutable)' != 'true' and $([MSBuild]::IsOSPlatform('Windows'))" />
<LinkerArg Include="-Wl,-install_name,&quot;$(SharedLibraryInstallName)&quot;" Condition="'$(_IsiOSLikePlatform)' == 'true' and '$(NativeLib)' == 'Shared'" />
<LinkerArg Include="-Wl,--build-id=sha1" Condition="'$(_IsApplePlatform)' != 'true'" />
<LinkerArg Include="-Wl,--as-needed" Condition="'$(_IsApplePlatform)' != 'true'" />
<LinkerArg Include="-Wl,-e0x0" Condition="'$(NativeLib)' == 'Shared' and '$(_IsApplePlatform)' != 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' == 'win' and '$(NativeLib)' == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' != 'win' and '$(NativeLib)' == 'Static'">.a</NativeBinaryExt>

<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_IsApplePlatform)' == 'true'">.dsym</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_IsApplePlatform)' == 'true'">.dSYM</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_targetOS)' == 'win'">.pdb</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == ''">.dbg</NativeSymbolExt>

Expand Down
3 changes: 2 additions & 1 deletion src/libraries/sendtohelix-mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<iOSLikeLibraryBuilderTargetsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'msbuild', 'common'))</iOSLikeLibraryBuilderTargetsDir>
<WorkItemPrefix Condition="'$(Scenario)' == 'BuildiOSApps' and '$(TestUsingWorkloads)' != 'true'">$(TargetOS)-</WorkItemPrefix>

<CMakeUrl>https://netcorenativeassets.blob.core.windows.net/resource-packages/external/macos/cmake/cmake-3.16.4-Darwin-x86_64.tar.gz</CMakeUrl>
<CMakeUrl>https://netcorenativeassets.blob.core.windows.net/resource-packages/external/macos/cmake/cmake-3.28.0-macos-universal.tar.gz</CMakeUrl>

<_XHarnessAppleCustomCommand Condition="'$(NeedsiOSSDK)' == 'true'">
source build-apple-app.sh
Expand All @@ -64,6 +64,7 @@
<ItemGroup Condition="'$(NeedsiOSSDK)' == 'true'">
<HelixCorrelationPayload Include="cmake" Uri="$(CMakeUrl)" Destination="build/cmake" />
<HelixCorrelationPayload Include="$(AppleAppBuilderDir)" Destination="build/AppleAppBuilder" />
<HelixCorrelationPayload Include="$(LibraryBuilderDir)" Destination="build/LibraryBuilder" />
<HelixCorrelationPayload Include="$(MonoAOTCompilerDir)" Condition="'$(RuntimeFlavor)' == 'mono'"
Destination="build/MonoAOTCompiler" />
<HelixCorrelationPayload Include="$(MicrosoftNetCoreAppRuntimePackDir)" Destination="build/microsoft.netcore.app.runtime.$(TargetOS)-$(TargetArchitecture.ToLower())" />
Expand Down
5 changes: 3 additions & 2 deletions src/mono/msbuild/apple/build/AppleBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<!-- iOS/tvOS arm64 simulators do not support JIT, so force interpreter fallback, devices should FullAOT -->
<PropertyGroup Condition="('$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvossimulator') And '$(TargetArchitecture)' == 'arm64'">
<PropertyGroup Condition="('$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvossimulator') And '$(TargetArchitecture)' == 'arm64' and '$(UseNativeAOTRuntime)' != 'true'">
<MonoForceInterpreter Condition="'$(MonoForceInterpreter)' == ''">true</MonoForceInterpreter>
</PropertyGroup>

Expand All @@ -19,7 +19,8 @@
<!-- Tracking issue: https://github.com/dotnet/runtime/issues/87740 -->
<!-- <ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip> -->

<_IsLibraryMode Condition="'$(UseNativeAOTRuntime)' != 'true' and '$(NativeLib)' != ''">true</_IsLibraryMode>
<!-- TODO: We currently do not support bundling a static iOS-library with NativeAOT -->
<_IsLibraryMode Condition="('$(UseNativeAOTRuntime)' != 'true' and '$(NativeLib)' != '') or ('$(UseNativeAOTRuntime)' == 'true' and '$(NativeLib)' == 'Shared')">true</_IsLibraryMode>

<_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' == 'true'">_AppleNativeAotCompile</_AotCompileTargetName>
<_AotCompileTargetName Condition="'$(UseNativeAOTRuntime)' != 'true'">_AppleAotCompile</_AotCompileTargetName>
Expand Down
13 changes: 7 additions & 6 deletions src/mono/msbuild/apple/build/AppleBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AppleGenerateAppBundle Condition="'$(AppleGenerateAppBundle)' == ''">true</AppleGenerateAppBundle>
<!-- Unable to properly integrate nativelib into app build, so not supported for now. -->
<AppleGenerateAppBundle Condition="'$(_IsLibraryMode)' == 'true' and '$(ForceLibraryModeGenerateAppBundle)' != 'true' and '$(UseNativeAOTRuntime)' != 'true'">false</AppleGenerateAppBundle>
<_ProcessRuntimeComponentsForLibraryMode Condition="'$(_IsLibraryMode)' == 'true'">_ProcessRuntimeComponentsForLibraryMode</_ProcessRuntimeComponentsForLibraryMode>
<_ProcessRuntimeComponentsForLibraryMode Condition="'$(_IsLibraryMode)' == 'true' and '$(UseNativeAOTRuntime)' != 'true'">_ProcessRuntimeComponentsForLibraryMode</_ProcessRuntimeComponentsForLibraryMode>
<EnableDefaultAssembliesToBundle Condition="'$(EnableDefaultAssembliesToBundle)' == ''">false</EnableDefaultAssembliesToBundle>
</PropertyGroup>

Expand Down Expand Up @@ -267,25 +267,26 @@
</Target>

<Target Name="_AppleNativeAotCompile"
DependsOnTargets="SetupProperties;ComputeIlcCompileInputs;IlcCompile" />
DependsOnTargets="SetupProperties;ComputeIlcCompileInputs;IlcCompile;$(_IlcLibraryBuildDependsOn)" />

<Target Name="_AppleGenerateAppBundle"
Condition="'$(AppleGenerateAppBundle)' == 'true'"
DependsOnTargets="_AppleGenerateRuntimeConfig">
<!-- Run App bundler, it uses AOT libs (if needed), link all native bits, compile simple UI (written in ObjC)
and produce an app bundle (with xcode project) -->

<Error Condition="'$(NativeMainSource)' != '' and !Exists('$(NativeMainSource)')" Text="Project property NativeMainSource is defined, but the specified file: '$(NativeMainSource)' does not exist." />

<ItemGroup>
<ExtraAppLinkerArgs Include="@(_CommonLinkerArgs)" />
</ItemGroup>

<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
<ItemGroup Condition="'$(_IsLibraryMode)' == 'true' and '$(UseNativeAOTRuntime)' != 'true'">
<NativeDependencies Include="$(LibraryOutputPath)" />
</ItemGroup>

<Error Condition="'$(NativeMainSource)' != '' and !Exists('$(NativeMainSource)')" Text="Project property NativeMainSource is defined, but the specified file: '$(NativeMainSource)' does not exist." />

<ItemGroup Condition="'$(UseNativeAOTRuntime)' == 'true'">
<!-- Only pass additional linker flags with NativeAOT when we are not in the library mode -->
<ItemGroup Condition="'$(_IsLibraryMode)' != 'true' and '$(UseNativeAOTRuntime)' == 'true'">
<NativeDependencies Condition="$(NativeDependencies) == ''" Include="%(ManagedBinary.IlcOutputFile)" />
<_LinkerFlagsToDrop Include="@(NativeFramework->'-framework %(Identity)')" />
<LinkerArg Remove="@(_LinkerFlagsToDrop)" />
Expand Down
33 changes: 28 additions & 5 deletions src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,36 @@
</PropertyGroup>

<PropertyGroup Condition="'$(UseNativeAOTRuntime)' == 'true'">
<IntermediateOutputPath>$(OriginalPublishDir)</IntermediateOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<UseArtifactsIntermediateOutput>true</UseArtifactsIntermediateOutput>
<NativeLib>static</NativeLib>
<CustomNativeMain>true</CustomNativeMain>
<NativeCompilationDuringPublish>false</NativeCompilationDuringPublish>
<_UseNativeAOTLibraryModeBundling Condition="'$(NativeLib)' == 'Shared'">true</_UseNativeAOTLibraryModeBundling>

<_IsApplePlatform>true</_IsApplePlatform>
<TargetsAppleMobile>true</TargetsAppleMobile>
<_targetOS>$(TargetOS)</_targetOS>

<!-- Forced by ILLink targets -->
<SelfContained>true</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(_UseNativeAOTLibraryModeBundling)' != 'true'">
<!-- TODO: we probably want to recreate everything in the intermediate directory instead (see library mode bellow) -->
<IntermediateOutputPath>$(OriginalPublishDir)</IntermediateOutputPath>
<NativeLib>static</NativeLib>
<CustomNativeMain>true</CustomNativeMain>
<NativeCompilationDuringPublish>false</NativeCompilationDuringPublish>
</PropertyGroup>
<!-- In library mode we depend on NativeAOT publish integration targets -->
<PropertyGroup Condition="'$(_UseNativeAOTLibraryModeBundling)' == 'true'">
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>
<OutputPath>$([MSBuild]::NormalizeDirectory($(TestRootDir), '..', 'bin'))</OutputPath>
<PublishDir>$(OriginalPublishDir)</PublishDir>
<_IlcLibraryBuildDependsOn>LinkNative;CopyNativeBinary</_IlcLibraryBuildDependsOn>
<!-- we should not strip symbols from the generated library as xcode build will attempt to strip already stripped symbols -->
<StripSymbols>false</StripSymbols>
</PropertyGroup>

<ItemGroup Condition="'$(UseNativeAOTRuntime)' == 'true'">
<DirectPInvoke Include="__Internal" />
</ItemGroup>
Expand Down Expand Up @@ -57,6 +73,13 @@
<AppleNativeFilesToBundle Include="$(OriginalPublishDir)\**\*.*" Exclude="$(OriginalPublishDir)\*.dll" />
</ItemGroup>

<!-- For NativeAOT library mode we need to manually create the 'obj' dir and copy all assemblies in there to properly build the library -->
<MakeDir Condition="'$(_UseNativeAOTLibraryModeBundling)' == 'true'"
Directories="$(IntermediateOutputPath)" />
<Copy Condition="'$(_UseNativeAOTLibraryModeBundling)' == 'true'"
SourceFiles="@(AppleAssembliesToBundle)"
DestinationFolder="$(IntermediateOutputPath)" />

<PropertyGroup Condition="'$(UseRuntimeComponents)' == 'true'">
<DiagnosticPorts>127.0.0.1:9000,nosuspend,listen</DiagnosticPorts>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ enable_language(OBJC ASM)

set(APP_RESOURCES
%AppResources%
lib%ProjectName%.dylib
)

add_executable(
%ProjectName%
%MainSource%
${APP_RESOURCES}
util.h
util.m
runtime-librarymode.h
runtime-librarymode.m
)

if(NOT %UseNativeAOTRuntime%)
target_sources(
%ProjectName%
PRIVATE
runtime.m)
endif()

%Defines%

if(NOT %UseNativeAOTRuntime%)
Expand All @@ -36,6 +32,7 @@ set_target_properties(%ProjectName% PROPERTIES
XCODE_EMBED_FRAMEWORKS "%DYLIB_PATH%"
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks"
XCODE_ATTRIBUTE_SUPPORTS_MACCATALYST "YES"
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY "YES"
RESOURCE "${APP_RESOURCES}"
)

Expand Down
Loading

0 comments on commit 9eca186

Please sign in to comment.