diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2018-01-15 21:21:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-04 14:03:35 (GMT) |
commit | 11da882a1293b39ddd054342b1e6f2f3bd1bc934 (patch) | |
tree | 187dc31245841919d54a28a566b5e0e8550c6980 /Modules/Platform/Darwin-Initialize.cmake | |
parent | 36cf44a7a3a8931c97790db6df61439d4dd86ea3 (diff) | |
download | CMake-11da882a1293b39ddd054342b1e6f2f3bd1bc934.zip CMake-11da882a1293b39ddd054342b1e6f2f3bd1bc934.tar.gz CMake-11da882a1293b39ddd054342b1e6f2f3bd1bc934.tar.bz2 |
Apple: Introduce separate system name for iOS, tvOS, and watchOS
- Remove code signing requirements for non-macOS
- Do not set deployment target for non-macOS
- Build static library for compiler feature detection for non-macOS
- Use framework to run CompilerId tests for watchOS
- Port tests to new SDK handling
- Add new Apple cross-compiling section to toolchain documentation
Closes: #17870
Diffstat (limited to 'Modules/Platform/Darwin-Initialize.cmake')
-rw-r--r-- | Modules/Platform/Darwin-Initialize.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 3db77aa..2d797f6 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -34,7 +34,7 @@ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1" # CMAKE_OSX_DEPLOYMENT_TARGET # Set cache variable - end user may change this during ccmake or cmake-gui configure. -if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND _CURRENT_OSX_VERSION VERSION_GREATER 10.3) set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.") endif() @@ -49,6 +49,12 @@ elseif(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND (NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}")) # Use the value of SDKROOT from the environment. set(_CMAKE_OSX_SYSROOT_DEFAULT "$ENV{SDKROOT}") +elseif(CMAKE_SYSTEM_NAME STREQUAL iOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "iphoneos") +elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "appletvos") +elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "watchos") elseif("${CMAKE_GENERATOR}" MATCHES Xcode OR CMAKE_OSX_DEPLOYMENT_TARGET OR CMAKE_OSX_ARCHITECTURES MATCHES "[^;]" |