diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2017-11-04 14:27:48 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2017-12-22 20:56:53 (GMT) |
commit | 4017bf40de512e977d59c12f4e3f6c91f5dd953d (patch) | |
tree | 4ef1e4b8d4b325e5a746273c1d036d29215a82b4 /Modules/Platform | |
parent | 8f4663ffb265b6216cc9da9019e6169e27f0d8ec (diff) | |
download | CMake-4017bf40de512e977d59c12f4e3f6c91f5dd953d.zip CMake-4017bf40de512e977d59c12f4e3f6c91f5dd953d.tar.gz CMake-4017bf40de512e977d59c12f4e3f6c91f5dd953d.tar.bz2 |
Darwin: Emit deployment target that matches the SDK
Closes: #17431
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Darwin-Clang.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/Platform/Darwin-Clang.cmake b/Modules/Platform/Darwin-Clang.cmake index a6661a8..f8a07ec 100644 --- a/Modules/Platform/Darwin-Clang.cmake +++ b/Modules/Platform/Darwin-Clang.cmake @@ -17,4 +17,19 @@ macro(__darwin_compiler_clang lang) if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.2) set(CMAKE_${lang}_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ") endif() + if(_CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhoneOS") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-miphoneos-version-min=") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhoneSimulator") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mios-simulator-version-min=") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTVOS") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-version-min=") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTVSimulator") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-simulator-version-min=") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchOS") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mwatchos-version-min=") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchSimulator") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mwatchos-simulator-version-min=") + else() + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=") + endif() endmacro() |