diff options
author | Brad King <brad.king@kitware.com> | 2018-04-19 12:20:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-04-19 12:20:15 (GMT) |
commit | 541b53375de703ad5bb7a90cd72beefbb5452f96 (patch) | |
tree | 913b7a40a9be498ee67510625a7048fb84a14dc9 /Modules/Platform/Apple-Clang.cmake | |
parent | 67752aece33ca0643a354ce0f2037afc66d15bfc (diff) | |
parent | 459739678443d2d2074d6e1475e4267c6c110e05 (diff) | |
download | CMake-541b53375de703ad5bb7a90cd72beefbb5452f96.zip CMake-541b53375de703ad5bb7a90cd72beefbb5452f96.tar.gz CMake-541b53375de703ad5bb7a90cd72beefbb5452f96.tar.bz2 |
Merge topic '17870-effective-system-name'
4597396784 Apple: Use include_guard() within compiler config
e95b3fd9bb Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info
84f9f63fcc Modules: Introduce CMAKE_EFFECTIVE_SYSTEM_NAME to lookup compiler info
9fa0f2eb56 CMakeFindPackageMode: Perform platform-specific initialization
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1964
Diffstat (limited to 'Modules/Platform/Apple-Clang.cmake')
-rw-r--r-- | Modules/Platform/Apple-Clang.cmake | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake new file mode 100644 index 0000000..0681bfb --- /dev/null +++ b/Modules/Platform/Apple-Clang.cmake @@ -0,0 +1,32 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__apple_compiler_clang lang) + set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") + set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names") + set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=") + 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() |