CMake/Modules/Platform/iOS-Initialize.cmake
Brad King 79a83ddb08 Apple: Enable linking during iOS/tvOS/visionOS/watchOS toolchain inspection
Since commit 11da882a12 (Apple: Introduce separate system name for iOS,
tvOS, and watchOS, 2018-01-15, v3.14.0-rc1~14^2~1) our toolchain
inspection steps, like ABI detection, tell `try_compile` to use a
`STATIC_LIBRARY` instead of an `EXECUTABLE`.  This was needed at the
time to avoid codesign requirements.  However, commit d3a64c4e3f (Xcode:
Explicitly turn off signing in try_compile projects, 2020-07-16,
v3.19.0-rc1~483^2) introduced a more general solution to that problem.
Restore linking during toolchain inspection so that we can detect and
identify the linker.

Suggested-by: Marc Chevrier <marc.chevrier@gmail.com>
Fixes: #26443
2024-11-14 11:06:49 -05:00

8 lines
198 B
CMake

include(Platform/Darwin-Initialize)
if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/(iPhoneOS|iPhoneSimulator|MacOSX)")
message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an iOS SDK")
endif()
set(IOS 1)