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

WIP: Build CoreCLR for Mac Catalyst OS #51000

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4981587
Initial support for compiling clr runtime subset against maccatalyst
directhex Mar 31, 2021
b697a83
Fix build on x64
directhex Mar 31, 2021
bd073e5
Merge remote-tracking branch 'origin/main' into maccatalyst-coreclr
directhex Apr 21, 2021
dd65b4e
Allow 'clr' subset to work for Mac Catalyst
directhex Apr 21, 2021
9a0b667
Re-order, so single file host builds after -DTARGET_MACCATALYST is im…
directhex Apr 21, 2021
c813a32
Don't build/depend on Mono corelib
directhex Apr 21, 2021
914c0e6
Better handling of runtimeflavor
directhex Apr 21, 2021
5de69c2
Fix
directhex Apr 21, 2021
397849d
Don't do XplatEventSource on Catalyst
directhex Apr 21, 2021
3694620
Add System.Globalization.Native to build. Removes need for invariant …
directhex Apr 22, 2021
eeba7e6
Allow AppleTestRunner.dll to run on non-mono w/ CoreRun
directhex Apr 22, 2021
28c754b
Add more native libs to the build
directhex Apr 22, 2021
593b42b
Allow AppleAppBuilder to build a CoreCLR Catalyst app
directhex Apr 23, 2021
58e470a
Fix up coreclr runtime template
directhex Apr 26, 2021
a3970e1
Add CoreCLR Catalyst x64 to runtime-staging
directhex Apr 26, 2021
9cc3afc
Merge remote-tracking branch 'origin/main' into maccatalyst-coreclr
directhex Apr 26, 2021
51d2c76
Don't only run Catalyst on FullMatrix
directhex Apr 26, 2021
189422a
Don't hardcode Mono RuntimeFlavor on Catalyst
directhex Apr 26, 2021
5432b12
Treat Catalyst like OSX in AzDO
directhex Apr 26, 2021
52c17ac
Add Catalyst to eng/install-native-dependencies.sh
directhex Apr 26, 2021
a996d91
CoreCLR bypasses build.sh, ensure we pass an OS to build-runtime.sh
directhex Apr 26, 2021
d47bc74
Try passing osArg into native test component build
directhex Apr 26, 2021
80730bf
Don't try to build stuff we aren't targeting on MacCatalyst
directhex Apr 26, 2021
8f25396
Force Flavor to be specified, as we use it for coreclr vs mono Catalyst
directhex Apr 26, 2021
c3433be
Ensure coreclrhost.h is bundled into artifacts folder
directhex Apr 27, 2021
cf6529d
Try to get include folder into mobile runtime pack on mobile
directhex Apr 27, 2021
a03399d
Only build system.buffers.tests for now, to avoid disk full noise in CI
directhex Apr 27, 2021
1d3f34e
Don't exclude libcoreclr.dylib from Resources/
directhex Apr 27, 2021
9958dcf
Fix up coreclr vs mono headers path
directhex Apr 27, 2021
fd9844f
Required Catalyst Helix changes from #51139
directhex Apr 27, 2021
9a0ec57
Typo
directhex Apr 27, 2021
153de52
Fix on ios, clean up unused ObjC code
directhex Apr 27, 2021
0f3ed14
Revert "Only build system.buffers.tests for now, to avoid disk full n…
directhex Apr 27, 2021
e66fefd
Merge remote-tracking branch 'origin/main' into maccatalyst-coreclr
directhex Apr 27, 2021
4c7d848
Skip .dwarf files on Mobile targets, TOO CHONKY
directhex Apr 27, 2021
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
5 changes: 3 additions & 2 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
<PropertyGroup>
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' or ((!$(_subset.Contains('+mono+')) and !$(_subset.Contains('+mono.runtime+'))) and ($(_subset.Contains('+clr+')) or $(_subset.Contains('+clr.runtime+'))))">CoreCLR</RuntimeFlavor>
</PropertyGroup>

<PropertyGroup>
<DefaultCoreClrSubsets>clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets>clr.native+clr.corelib</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(TargetOS)' != 'MacCatalyst'">$(DefaultCoreClrSubsets)+linuxdac+clr.tools+clr.nativecorelib+clr.packages</DefaultCoreClrSubsets>

<DefaultMonoSubsets Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">mono.llvm+</DefaultMonoSubsets>
<DefaultMonoSubsets Condition="'$(MonoAOTEnableLLVM)' == 'true' and '$(MonoAOTLLVMDir)' == ''">mono.llvm+</DefaultMonoSubsets>
Expand Down
4 changes: 2 additions & 2 deletions eng/install-native-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ "$1" = "Linux" ]; then
if [ "$?" != "0" ]; then
exit 1;
fi
elif [ "$1" = "OSX" ] || [ "$1" = "tvOS" ] || [ "$1" = "iOS" ]; then
elif [ "$1" = "OSX" ] || [ "$1" = "MacCatalyst" ] || [ "$1" = "tvOS" ] || [ "$1" = "iOS" ]; then
engdir=$(dirname "${BASH_SOURCE[0]}")

if [ "$3" = "azDO" ]; then
Expand All @@ -47,7 +47,7 @@ elif [ "$1" = "OSX" ] || [ "$1" = "tvOS" ] || [ "$1" = "iOS" ]; then
exit 1;
fi
else
echo "Must pass \"Linux\", \"tvOS\", \"iOS\" or \"OSX\" as first argument."
echo "Must pass \"Linux\", \"tvOS\", \"iOS\", \"MacCatalyst\" or \"OSX\" as first argument."
exit 1
fi

4 changes: 3 additions & 1 deletion eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
<TargetPath>runtime/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native</TargetPath>
<IsNative>true</IsNative>
</CoreCLRCrossTargetFiles>
<RuntimeIncludeFiles Condition="'$(TargetsMobile)' == 'true'"
Include="$(CoreCLRArtifactsPath)\..\..\..\..\src\coreclr\hosts\inc\**\*.*" />
</ItemGroup>
<ItemGroup Condition="'$(RuntimeFlavor)' == 'Mono'">
<RuntimeFiles Include="$(MonoArtifactsPath)\*.*" />
Expand All @@ -111,7 +113,7 @@

<MonoCrossFiles Condition="'$(TargetsMobile)' == 'true'"
Include="$(MonoArtifactsPath)\cross\**\*.*" />
<MonoIncludeFiles Condition="'$(TargetsMobile)' == 'true'"
<RuntimeIncludeFiles Condition="'$(TargetsMobile)' == 'true'"
Include="$(MonoArtifactsPath)\include\**\*.*" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ jobs:
targetRid: maccatalyst-x64
platform: MacCatalyst_x64
jobParameters:
runtimeFlavor: mono
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
Expand All @@ -402,7 +402,7 @@ jobs:
targetRid: maccatalyst-arm64
platform: MacCatalyst_arm64
jobParameters:
runtimeFlavor: mono
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
Expand Down
10 changes: 5 additions & 5 deletions eng/pipelines/coreclr/templates/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
- name: compilerArg
value: ''
# AppleClang has different version scheme, so we let complier introspection pick up the available clang from PATH
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst') }}:
- name: compilerArg
value: ''
- ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
# Linux builds use docker images with dependencies preinstalled,
# and FreeBSD builds use a build agent with dependencies
# preinstalled, so we only need this step for OSX and Windows.
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
displayName: Install native dependencies
- ${{ if eq(parameters.osGroup, 'windows') }}:
Expand All @@ -175,7 +175,7 @@ jobs:
continueOnError: false
condition: and(succeeded(), in(variables['SignType'], 'real', 'test'))

- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'MacCatalyst') }}:
- script: |
du -sh $(Build.SourcesDirectory)/*
df -h
Expand All @@ -194,7 +194,7 @@ jobs:
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(enforcePgoArg) $(pgoInstrumentArg) $(officialBuildIdArg) $(clrInterpreterBuildArg)
displayName: Build CoreCLR Runtime

- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'MacCatalyst') }}:
- script: |
du -sh $(Build.SourcesDirectory)/*
df -h
Expand All @@ -216,7 +216,7 @@ jobs:

# Sign and add entitlements to these MacOS binaries
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst') }}:

- template: /eng/pipelines/common/macos-sign-with-entitlements.yml
parameters:
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- _runtimeOSArg: /p:RuntimeOS=ubuntu.16.04

# force a value for OS when cross-building
- ${{ if in(parameters.osGroup, 'Browser', 'iOS', 'tvOS', 'Android', 'FreeBSD') }}:
- ${{ if in(parameters.osGroup, 'Browser', 'iOS', 'MacCatalyst', 'tvOS', 'Android', 'FreeBSD') }}:
- _osArg: -os ${{ parameters.osGroup }}

- ${{ if ne(parameters.framework, '') }}:
Expand Down
28 changes: 28 additions & 0 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,34 @@ jobs:
buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig)
timeoutInMinutes: 120

#
# CoreCLR Build for running Mac Catalyst libraries-innerloop
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml
buildConfig: release
platforms:
- MacCatalyst_x64
jobParameters:
testGroup: innerloop
#
# Libraries Build for running Mac Catalyst libraries-innerloop
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Release
platforms:
- MacCatalyst_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isOfficialBuild: ${{ variables['isOfficialBuild'] }}
isFullMatrix: ${{ variables['isFullMatrix'] }}
runTests: true
testScope: innerloop
liveRuntimeBuildConfig: release

#
# CoreCLR Build for running Apple Silicon libraries-innerloop
#
Expand Down
6 changes: 4 additions & 2 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<UseDefaultAndroidFeatureSwitches Condition="'$(UseDefaultAndroidFeatureSwitches)' == ''">true</UseDefaultAndroidFeatureSwitches>
<UseDefaultiOSFeatureSwitches Condition="'$(UseDefaultiOSFeatureSwitches)' == ''">true</UseDefaultiOSFeatureSwitches>
<BundleTestAppTargets>BundleTestAppleApp;BundleTestAndroidApp</BundleTestAppTargets>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">mono</RuntimeFlavor>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetOS)' == 'Android' and '$(UseDefaultAndroidFeatureSwitches)' == 'true'">
Expand Down Expand Up @@ -190,7 +191,7 @@
TargetOS="$(TargetOS)"
Arch="$(TargetArchitecture)"
ProjectName="$(AssemblyName)"
MonoRuntimeHeaders="$(MicrosoftNetCoreAppRuntimePackNativeDir)include\mono-2.0"
RuntimeHeaders="$(MicrosoftNetCoreAppRuntimePackNativeDir)include"
Assemblies="@(BundleAssemblies)"
MainLibraryFileName="$(MainLibraryFileName)"
ForceAOT="$(RunAOTCompilation)"
Expand All @@ -202,7 +203,8 @@
Optimized="$(Optimized)"
DevTeamProvisioning="$(DevTeamProvisioning)"
OutputDirectory="$(BundleDir)"
AppDir="$(PublishDir)">
AppDir="$(PublishDir)"
RuntimeFlavor="$(RuntimeFlavor)">
<Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
<Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
</AppleAppBuilderTask>
Expand Down
17 changes: 9 additions & 8 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ include(pgosupport.cmake)
#---------------------------------------------------
include(components.cmake)

#---------------------------
# Build the single file host
#---------------------------
if(NOT CLR_CROSS_COMPONENTS_BUILD)
set(CLR_SINGLE_FILE_HOST_ONLY 1)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/corehost/apphost/static Corehost.Static)
add_dependencies(runtime singlefilehost)
endif()
#-------------------------
# Enable C++ EH with SEH
#-------------------------
Expand Down Expand Up @@ -143,6 +135,15 @@ endif(CLR_CMAKE_HOST_WIN32)
#----------------------------------
include(clrdefinitions.cmake)

#---------------------------
# Build the single file host
#---------------------------
if(NOT CLR_CROSS_COMPONENTS_BUILD)
set(CLR_SINGLE_FILE_HOST_ONLY 1)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/corehost/apphost/static Corehost.Static)
add_dependencies(runtime singlefilehost)
endif()

if(FEATURE_STANDALONE_GC)
add_definitions(-DFEATURE_STANDALONE_GC)
add_subdirectory(gc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<ILLinkDirectory>$(MSBuildThisFileDirectory)src\ILLink\</ILLinkDirectory>

<FeaturePortableThreadPool>true</FeaturePortableThreadPool>

<IsiOSLike Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">true</IsiOSLike>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -287,6 +289,12 @@
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CustomMarshalers\TypeToTypeInfoMarshaler.cs" />
<Compile Include="$(BclSourcesRoot)\System\Variant.cs" />
</ItemGroup>
<ItemGroup Condition="'$(IsiOSLike)' == 'true'">
<Compile Include="$(BclSourcesRoot)\System\Environment.iOS.cs"/>
<Compile Include="$(CommonPath)Interop\OSX\System.Native\Interop.SearchPath.cs">
<Link>Common\Interop\OSX\Interop.SearchPath.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="$(BclSourcesRoot)\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\ClrThreadPoolBoundHandle.Unix.cs" />
Expand Down
105 changes: 105 additions & 0 deletions src/coreclr/System.Private.CoreLib/src/System/Environment.iOS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.IO;
using System.Threading;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using NSSearchPathDirectory = Interop.Sys.NSSearchPathDirectory;

namespace System
{
public static partial class Environment
{
private static Dictionary<SpecialFolder, string>? s_specialFolders;

private static string GetFolderPathCore(SpecialFolder folder, SpecialFolderOption option)
{
if (s_specialFolders == null)
{
Interlocked.CompareExchange(ref s_specialFolders, new Dictionary<SpecialFolder, string>(), null);
}

string? path;
lock (s_specialFolders)
{
if (!s_specialFolders.TryGetValue(folder, out path))
{
path = GetSpecialFolder(folder) ?? string.Empty;
s_specialFolders[folder] = path;
}
}
return path;
}

private static string? GetSpecialFolder(SpecialFolder folder)
{
switch (folder)
{
// TODO: fix for tvOS (https://github.com/dotnet/runtime/issues/34007)
// The "normal" NSDocumentDirectory is a read-only directory on tvOS
// and that breaks a lot of assumptions in the runtime and the BCL

case SpecialFolder.Personal:
case SpecialFolder.LocalApplicationData:
return Interop.Sys.SearchPath(NSSearchPathDirectory.NSDocumentDirectory);

case SpecialFolder.ApplicationData:
// note: at first glance that looked like a good place to return NSLibraryDirectory
// but it would break isolated storage for existing applications
return CombineSearchPath(NSSearchPathDirectory.NSDocumentDirectory, ".config");

case SpecialFolder.Resources:
return Interop.Sys.SearchPath(NSSearchPathDirectory.NSLibraryDirectory); // older (8.2 and previous) would return String.Empty

case SpecialFolder.Desktop:
case SpecialFolder.DesktopDirectory:
return Path.Combine(GetFolderPathCore(SpecialFolder.Personal, SpecialFolderOption.None), "Desktop");

case SpecialFolder.MyMusic:
return Path.Combine(GetFolderPathCore(SpecialFolder.Personal, SpecialFolderOption.None), "Music");

case SpecialFolder.MyPictures:
return Path.Combine(GetFolderPathCore(SpecialFolder.Personal, SpecialFolderOption.None), "Pictures");

case SpecialFolder.Templates:
return CombineSearchPath(NSSearchPathDirectory.NSDocumentDirectory, "Templates");

case SpecialFolder.MyVideos:
return Path.Combine(GetFolderPathCore(SpecialFolder.Personal, SpecialFolderOption.None), "Videos");

case SpecialFolder.CommonTemplates:
return "/usr/share/templates";

case SpecialFolder.Fonts:
return CombineSearchPath(NSSearchPathDirectory.NSDocumentDirectory, ".fonts");

case SpecialFolder.Favorites:
return CombineSearchPath(NSSearchPathDirectory.NSLibraryDirectory, "Favorites");

case SpecialFolder.ProgramFiles:
return Interop.Sys.SearchPath(NSSearchPathDirectory.NSApplicationDirectory);

case SpecialFolder.InternetCache:
return Interop.Sys.SearchPath(NSSearchPathDirectory.NSCachesDirectory);

case SpecialFolder.UserProfile:
return GetEnvironmentVariable("HOME");

case SpecialFolder.CommonApplicationData:
return "/usr/share";

default:
return string.Empty;
}

static string CombineSearchPath(NSSearchPathDirectory searchPath, string subdirectory)
{
string? path = Interop.Sys.SearchPath(searchPath);
return path != null ?
Path.Combine(path, subdirectory) :
string.Empty;
}
}
}
}
2 changes: 1 addition & 1 deletion src/coreclr/clr.featuredefines.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsUnix)' == 'true'">
<FeatureXplatEventSource Condition="'$(TargetOS)'!='OSX'">true</FeatureXplatEventSource>
<FeatureXplatEventSource Condition="'$(TargetOS)'!='OSX' and '$(TargetOS)' != 'MacCatalyst'">true</FeatureXplatEventSource>

<FeatureArrayStubAsIL>true</FeatureArrayStubAsIL>
<FeatureMulticastStubAsIL>true</FeatureMulticastStubAsIL>
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ if(CLR_CMAKE_TARGET_OSX)
add_definitions(-DFEATURE_WRITEBARRIER_COPY)
endif(CLR_CMAKE_TARGET_OSX)

if(CLR_CMAKE_TARGET_MACCATALYST)
add_definitions(-DTARGET_MACCATALYST)
endif(CLR_CMAKE_TARGET_MACCATALYST)

if (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:FEATURE_EH_FUNCLETS>)
endif (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32)
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/dlls/mscoree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ list(APPEND CLR_SOURCES
Native.rc
)

if(CLR_CMAKE_TARGET_MACCATALYST)
add_definitions(-DTARGET_MACCATALYST)
endif(CLR_CMAKE_TARGET_MACCATALYST)

set (DEF_SOURCES
mscorwks_ntdef.src
)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ else(CLR_CMAKE_HOST_WIN32)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
endif(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD OR CLR_CMAKE_TARGET_SUNOS)

if(CLR_CMAKE_TARGET_OSX)
if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST)
# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -force_load)
set(END_WHOLE_ARCHIVE )
endif(CLR_CMAKE_TARGET_OSX)
endif(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST)

set_exports_linker_option(${EXPORTS_FILE})

Expand Down
Loading