Uh oh!
There was an error while loading. Please reload this page.
Introduce CLR_CMAKE_TARGET_APPLE_MOBILE for iOS/tvOS/MacCatalyst - #126833
Conversation
These three platforms share the same runtime constraints: static linking, no fork(), no build tools, hybrid globalization, no console signals, etc. Having each one listed individually in cmake conditions is verbose and error-prone — PR dotnet#126550 accidentally disabled FEATURE_CORPROFILER for tvOS alone, breaking unified-build tvOS legs. Introduce CLR_CMAKE_TARGET_APPLE_MOBILE as an umbrella variable in configureplatform.cmake, set when any of iOS, tvOS, or MacCatalyst is the target. Replace ~30 'all three grouped' patterns across 11 cmake files with the umbrella, reducing line noise and preventing future divergence. Per-platform variables are preserved where they genuinely differ: - configurecompiler.cmake: TARGET_* C++ defines and compiler targets - System.Security.Cryptography.Native.Apple: Swift platform names - System.Net.Security.Native / corehost: tvOS gssapi exclusion - System.Native: MacCatalyst pal_iossupportversion.m Also fixes: sendfile exclusion was missing MacCatalyst (now covered by APPLE_MOBILE), and the triplicated configure.cmake feature overrides for iOS/MacCatalyst/tvOS are consolidated into one block. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
There was a problem hiding this comment.
Pull request overview
Introduces a new CMake umbrella variable, CLR_CMAKE_TARGET_APPLE_MOBILE, to represent iOS/tvOS/MacCatalyst collectively, reducing duplicated platform conditionals and helping avoid unintended per-platform divergence in build feature logic.
Changes:
- Define
CLR_CMAKE_TARGET_APPLE_MOBILEineng/native/configureplatform.cmakewhen targeting iOS, tvOS, or MacCatalyst. - Replace repeated
(MACCATALYST OR IOS OR TVOS)/ negated variants across CoreCLR and native libraries CMake files with the new umbrella variable. - Consolidate several Apple-mobile-specific configure-time feature overrides (e.g., sendfile probing and TRY_RUN-derived feature defaults) under the umbrella check.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
eng/native/configureplatform.cmake | Defines CLR_CMAKE_TARGET_APPLE_MOBILE and uses it for zlib/tooling platform gating. |
src/native/libs/configure.cmake | Uses the umbrella to gate sendfile probes and Apple-mobile TRY_RUN overrides / header availability flags. |
src/native/libs/CMakeLists.txt | Uses umbrella for Apple-mobile install-name handling and to exclude System.IO.Ports.Native on Apple-mobile targets. |
src/coreclr/CMakeLists.txt | Uses umbrella to skip single-file host build on Apple-mobile targets. |
src/coreclr/clrfeatures.cmake | Uses umbrella to drive FEATURE_STATICALLY_LINKED for Apple-mobile targets. |
src/native/libs/System.Native/CMakeLists.txt | Replaces Apple-mobile platform triplets in console-signals and entrypoint-verification gating. |
src/native/libs/System.Globalization.Native/CMakeLists.txt | Replaces Apple-mobile platform triplets for hybrid globalization + ICU/static-ICU behavior. |
src/native/libs/System.IO.Compression.Native/CMakeLists.txt | Replaces Apple-mobile platform triplets for export generation / entrypoints inclusion gating. |
src/native/libs/System.IO.Compression.Native/extra_libs.cmake | Uses umbrella for Apple-mobile zlib link behavior selection. |
src/native/libs/System.Net.Security.Native/CMakeLists.txt | Replaces Apple-mobile platform triplets in entrypoints inclusion and verification gating. |
src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt | Uses umbrella to select iOS-family keychain/x509 source set and entrypoint-verification gating. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jkoritzinsky
left a comment
There was a problem hiding this comment.
LGTM once @akoeplinger's feedback is resolved.
MacCatalyst runs on macOS where sendfile() works and serial ports are available. Only iOS and tvOS need these exclusions (sendfile causes SIGSYS on physical devices, and IO.Ports has no hardware). Addresses PR feedback from akoeplinger. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
steveisok
commented
Apr 15, 2026
/ba-g Known issues and an unrelated helix deadletter. |
These three platforms share the same runtime constraints: static linking, no fork(), no build tools, hybrid globalization, no console signals, etc. Having each one listed individually in cmake conditions is verbose and error-prone — PR #126550 accidentally disabled FEATURE_CORPROFILER for tvOS alone, breaking unified-build tvOS legs.
Introduce CLR_CMAKE_TARGET_APPLE_MOBILE as an umbrella variable in configureplatform.cmake, set when any of iOS, tvOS, or MacCatalyst is the target. Replace ~30 'all three grouped' patterns across 11 cmake files with the umbrella, reducing line noise and preventing future divergence.
Per-platform variables are preserved where they genuinely differ:
Also fixes: sendfile exclusion was missing MacCatalyst (now covered by APPLE_MOBILE), and the triplicated configure.cmake feature overrides for iOS/MacCatalyst/tvOS are consolidated into one block.