Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set CMAKE_OSX_DEPLOYMENT_TARGET for all Mono AOT compilers on macOS #57507

Merged
merged 2 commits into from
Aug 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
<!-- Build AOT cross compiler (if available) -->
<Target Name="BuildMonoCross" Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'" DependsOnTargets="BuildMonoRuntime">

<!-- iOS specific options -->
<!-- iOS/tvOS specific options -->
<PropertyGroup Condition="'$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true'">
<!-- FIXME: Disable for simulator -->
<MonoUseCrossTool>true</MonoUseCrossTool>
Expand All @@ -546,24 +546,32 @@
<MonoAotAbi Condition="'$(Platform)' == 'x86'">i386-apple-darwin10</MonoAotAbi>
<MonoAotAbi Condition="'$(Platform)' == 'x64'">x86_64-apple-darwin10</MonoAotAbi>
</PropertyGroup>

<!-- Catalyst specific options -->
<PropertyGroup Condition="'$(TargetsMacCatalyst)' == 'true'">
<MonoUseCrossTool>true</MonoUseCrossTool>
<MonoAotCMakeSysroot Condition="'$(TargetsMacCatalyst)' == 'true'">$(XcodeDir)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk</MonoAotCMakeSysroot>
<MonoAotOffsetsFile>$(MonoObjCrossDir)offsets-$(Platform)-darwin.h</MonoAotOffsetsFile>
<MonoAotAbi Condition="'$(Platform)' == 'arm64'">aarch64-apple-maccatalyst</MonoAotAbi>
<MonoAotAbi Condition="'$(Platform)' == 'x64'">x86_64-apple-maccatalyst</MonoAotAbi>
</PropertyGroup>
<ItemGroup Condition="'$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">
<MonoAOTCMakeArgs Include="-DCMAKE_OSX_DEPLOYMENT_TARGET=$(macOSVersionMin)" />
</ItemGroup>

<!-- Linux specific options -->
<ItemGroup Condition="'$(RealTargetOS)' == 'Linux' or $([MSBuild]::IsOSPlatform('Linux'))">
<_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib64/libclang.so.*"/>
</ItemGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Linux' and '$(Platform)' == 'arm64'">
<MonoUseCrossTool>true</MonoUseCrossTool>
<MonoAotAbi>aarch64-linux-gnu</MonoAotAbi>
<MonoAotOffsetsFile>$(MonoObjCrossDir)offsets-aarch-linux-gnu.h</MonoAotOffsetsFile>
<MonoAotOffsetsPrefix>$(MonoCrossDir)/usr/lib/gcc/aarch64-linux-gnu/5</MonoAotOffsetsPrefix>
</PropertyGroup>

<!-- macOS host specific options -->
<ItemGroup Condition="'$(RealTargetOS)' == 'OSX' or $([MSBuild]::IsOSPlatform('OSX'))">
<MonoAOTCMakeArgs Include="-DCMAKE_OSX_DEPLOYMENT_TARGET=$(macOSVersionMin)" />
</ItemGroup>

<!-- WASM specific options -->
<PropertyGroup Condition="'$(TargetsBrowser)' == 'true'">
<MonoUseCrossTool>true</MonoUseCrossTool>
Expand All @@ -577,7 +585,7 @@
</PropertyGroup>

<!-- Windows specific options -->
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<ItemGroup Condition="'$(RealTargetOS)' == 'Windows' or $([MSBuild]::IsOSPlatform('Windows'))">
<_MonoAOTCPPFLAGS Include="-DHOST_WIN32" />
<_MonoAOTCPPFLAGS Include="-D__WIN32__" />
<_MonoAOTCPPFLAGS Include="-DWIN32" />
Expand Down Expand Up @@ -624,10 +632,6 @@
<MonoAotOffsetsFile>$(MonoObjDir)cross/offsets-$(Platform)-android.h</MonoAotOffsetsFile>
</PropertyGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib64/libclang.so.*"/>
</ItemGroup>

<PropertyGroup>
<MonoLibClang Condition="$([MSBuild]::IsOSPlatform('OSX')) and '$(MonoLibClang)' == ''">$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib</MonoLibClang>
<MonoLibClang Condition="$([MSBuild]::IsOSPlatform('Linux')) and '$(MonoLibClang)' == ''">@(_LibClang)</MonoLibClang>
Expand Down