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 | |
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')
34 files changed, 38 insertions, 46 deletions
diff --git a/Modules/Platform/Darwin-Absoft-Fortran.cmake b/Modules/Platform/Apple-Absoft-Fortran.cmake index 8caa202..8caa202 100644 --- a/Modules/Platform/Darwin-Absoft-Fortran.cmake +++ b/Modules/Platform/Apple-Absoft-Fortran.cmake diff --git a/Modules/Platform/Darwin-AppleClang-C.cmake b/Modules/Platform/Apple-AppleClang-C.cmake index 3216b29..f45ccf4 100644 --- a/Modules/Platform/Darwin-AppleClang-C.cmake +++ b/Modules/Platform/Apple-AppleClang-C.cmake @@ -1,4 +1,4 @@ -include(Platform/Darwin-Clang-C) +include(Platform/Apple-Clang-C) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) set(CMAKE_C_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ") else() diff --git a/Modules/Platform/Darwin-AppleClang-CXX.cmake b/Modules/Platform/Apple-AppleClang-CXX.cmake index 3fedf8c..1128204 100644 --- a/Modules/Platform/Darwin-AppleClang-CXX.cmake +++ b/Modules/Platform/Apple-AppleClang-CXX.cmake @@ -1,4 +1,4 @@ -include(Platform/Darwin-Clang-CXX) +include(Platform/Apple-Clang-CXX) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2) set(CMAKE_CXX_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ") else() diff --git a/Modules/Platform/Apple-Clang-C.cmake b/Modules/Platform/Apple-Clang-C.cmake new file mode 100644 index 0000000..4d0dc82 --- /dev/null +++ b/Modules/Platform/Apple-Clang-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-Clang) +__apple_compiler_clang(C) diff --git a/Modules/Platform/Apple-Clang-CXX.cmake b/Modules/Platform/Apple-Clang-CXX.cmake new file mode 100644 index 0000000..6c1ddc1 --- /dev/null +++ b/Modules/Platform/Apple-Clang-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-Clang) +__apple_compiler_clang(CXX) diff --git a/Modules/Platform/Darwin-Clang.cmake b/Modules/Platform/Apple-Clang.cmake index f8a07ec..0681bfb 100644 --- a/Modules/Platform/Darwin-Clang.cmake +++ b/Modules/Platform/Apple-Clang.cmake @@ -3,12 +3,9 @@ # This module is shared by multiple languages; use include blocker. -if(__DARWIN_COMPILER_CLANG) - return() -endif() -set(__DARWIN_COMPILER_CLANG 1) +include_guard() -macro(__darwin_compiler_clang lang) +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") diff --git a/Modules/Platform/Darwin-GNU-C.cmake b/Modules/Platform/Apple-GNU-C.cmake index efdfd00..5481c99 100644 --- a/Modules/Platform/Darwin-GNU-C.cmake +++ b/Modules/Platform/Apple-GNU-C.cmake @@ -1,4 +1,4 @@ -include(Platform/Darwin-GNU) -__darwin_compiler_gnu(C) +include(Platform/Apple-GNU) +__apple_compiler_gnu(C) cmake_gnu_set_sysroot_flag(C) cmake_gnu_set_osx_deployment_target_flag(C) diff --git a/Modules/Platform/Darwin-GNU-CXX.cmake b/Modules/Platform/Apple-GNU-CXX.cmake index e3c2ea7..727f726 100644 --- a/Modules/Platform/Darwin-GNU-CXX.cmake +++ b/Modules/Platform/Apple-GNU-CXX.cmake @@ -1,4 +1,4 @@ -include(Platform/Darwin-GNU) -__darwin_compiler_gnu(CXX) +include(Platform/Apple-GNU) +__apple_compiler_gnu(CXX) cmake_gnu_set_sysroot_flag(CXX) cmake_gnu_set_osx_deployment_target_flag(CXX) diff --git a/Modules/Platform/Darwin-GNU-Fortran.cmake b/Modules/Platform/Apple-GNU-Fortran.cmake index 568d79b..2f53603 100644 --- a/Modules/Platform/Darwin-GNU-Fortran.cmake +++ b/Modules/Platform/Apple-GNU-Fortran.cmake @@ -1,8 +1,8 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -include(Platform/Darwin-GNU) -__darwin_compiler_gnu(Fortran) +include(Platform/Apple-GNU) +__apple_compiler_gnu(Fortran) cmake_gnu_set_sysroot_flag(Fortran) cmake_gnu_set_osx_deployment_target_flag(Fortran) diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Apple-GNU.cmake index 9f9ef01..0eb8168 100644 --- a/Modules/Platform/Darwin-GNU.cmake +++ b/Modules/Platform/Apple-GNU.cmake @@ -3,12 +3,9 @@ # This module is shared by multiple languages; use include blocker. -if(__DARWIN_COMPILER_GNU) - return() -endif() -set(__DARWIN_COMPILER_GNU 1) +include_guard() -macro(__darwin_compiler_gnu lang) +macro(__apple_compiler_gnu lang) set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output # GNU does not have -shared on OS X set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") diff --git a/Modules/Platform/Apple-Intel-C.cmake b/Modules/Platform/Apple-Intel-C.cmake new file mode 100644 index 0000000..95bb270 --- /dev/null +++ b/Modules/Platform/Apple-Intel-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-Intel) +__apple_compiler_intel(C) diff --git a/Modules/Platform/Apple-Intel-CXX.cmake b/Modules/Platform/Apple-Intel-CXX.cmake new file mode 100644 index 0000000..b87e512 --- /dev/null +++ b/Modules/Platform/Apple-Intel-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-Intel) +__apple_compiler_intel(CXX) diff --git a/Modules/Platform/Darwin-Intel-Fortran.cmake b/Modules/Platform/Apple-Intel-Fortran.cmake index 2299da9..e54e237 100644 --- a/Modules/Platform/Darwin-Intel-Fortran.cmake +++ b/Modules/Platform/Apple-Intel-Fortran.cmake @@ -1,8 +1,8 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -include(Platform/Darwin-Intel) -__darwin_compiler_intel(Fortran) +include(Platform/Apple-Intel) +__apple_compiler_intel(Fortran) set(CMAKE_Fortran_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") set(CMAKE_Fortran_OSX_CURRENT_VERSION_FLAG "-current_version ") diff --git a/Modules/Platform/Darwin-Intel.cmake b/Modules/Platform/Apple-Intel.cmake index dd33cec..2d4f7e5 100644 --- a/Modules/Platform/Darwin-Intel.cmake +++ b/Modules/Platform/Apple-Intel.cmake @@ -3,12 +3,9 @@ # This module is shared by multiple languages; use include blocker. -if(__DARWIN_COMPILER_INTEL) - return() -endif() -set(__DARWIN_COMPILER_INTEL 1) +include_guard() -macro(__darwin_compiler_intel lang) +macro(__apple_compiler_intel 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") diff --git a/Modules/Platform/Darwin-NAG-Fortran.cmake b/Modules/Platform/Apple-NAG-Fortran.cmake index 8d3e741..8d3e741 100644 --- a/Modules/Platform/Darwin-NAG-Fortran.cmake +++ b/Modules/Platform/Apple-NAG-Fortran.cmake diff --git a/Modules/Platform/Darwin-NVIDIA-CUDA.cmake b/Modules/Platform/Apple-NVIDIA-CUDA.cmake index bec3948..bec3948 100644 --- a/Modules/Platform/Darwin-NVIDIA-CUDA.cmake +++ b/Modules/Platform/Apple-NVIDIA-CUDA.cmake diff --git a/Modules/Platform/Apple-PGI-C.cmake b/Modules/Platform/Apple-PGI-C.cmake new file mode 100644 index 0000000..1e11724 --- /dev/null +++ b/Modules/Platform/Apple-PGI-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-PGI) +__apple_compiler_pgi(C) diff --git a/Modules/Platform/Apple-PGI-CXX.cmake b/Modules/Platform/Apple-PGI-CXX.cmake new file mode 100644 index 0000000..aa5daf7 --- /dev/null +++ b/Modules/Platform/Apple-PGI-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-PGI) +__apple_compiler_pgi(CXX) diff --git a/Modules/Platform/Apple-PGI-Fortran.cmake b/Modules/Platform/Apple-PGI-Fortran.cmake new file mode 100644 index 0000000..1e3e4b1 --- /dev/null +++ b/Modules/Platform/Apple-PGI-Fortran.cmake @@ -0,0 +1,2 @@ +include(Platform/Apple-PGI) +__apple_compiler_pgi(Fortran) diff --git a/Modules/Platform/Darwin-PGI.cmake b/Modules/Platform/Apple-PGI.cmake index 04479a8..8d343b7 100644 --- a/Modules/Platform/Darwin-PGI.cmake +++ b/Modules/Platform/Apple-PGI.cmake @@ -2,12 +2,9 @@ # file Copyright.txt or https://cmake.org/licensing for details. # This module is shared by multiple languages; use include blocker. -if(__DARWIN_COMPILER_PGI) - return() -endif() -set(__DARWIN_COMPILER_PGI 1) +include_guard() -macro(__darwin_compiler_pgi lang) +macro(__apple_compiler_pgi lang) set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version,") set(CMAKE_${lang}_OSX_CURRENT_VERSION_FLAG "-Wl,-current_version,") set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-install_name") diff --git a/Modules/Platform/Apple-VisualAge-C.cmake b/Modules/Platform/Apple-VisualAge-C.cmake new file mode 100644 index 0000000..7fa6032 --- /dev/null +++ b/Modules/Platform/Apple-VisualAge-C.cmake @@ -0,0 +1 @@ +include(Platform/Apple-XL-C) diff --git a/Modules/Platform/Apple-VisualAge-CXX.cmake b/Modules/Platform/Apple-VisualAge-CXX.cmake new file mode 100644 index 0000000..12dd347 --- /dev/null +++ b/Modules/Platform/Apple-VisualAge-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Apple-XL-CXX) diff --git a/Modules/Platform/Darwin-XL-C.cmake b/Modules/Platform/Apple-XL-C.cmake index 2aeb132..2aeb132 100644 --- a/Modules/Platform/Darwin-XL-C.cmake +++ b/Modules/Platform/Apple-XL-C.cmake diff --git a/Modules/Platform/Darwin-XL-CXX.cmake b/Modules/Platform/Apple-XL-CXX.cmake index f8e1906..f8e1906 100644 --- a/Modules/Platform/Darwin-XL-CXX.cmake +++ b/Modules/Platform/Apple-XL-CXX.cmake diff --git a/Modules/Platform/Darwin-Clang-C.cmake b/Modules/Platform/Darwin-Clang-C.cmake deleted file mode 100644 index 0a1502e..0000000 --- a/Modules/Platform/Darwin-Clang-C.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Platform/Darwin-Clang) -__darwin_compiler_clang(C) diff --git a/Modules/Platform/Darwin-Clang-CXX.cmake b/Modules/Platform/Darwin-Clang-CXX.cmake deleted file mode 100644 index f8e8d88..0000000 --- a/Modules/Platform/Darwin-Clang-CXX.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Platform/Darwin-Clang) -__darwin_compiler_clang(CXX) diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index b539e45..3db77aa 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -20,6 +20,10 @@ execute_process(COMMAND sw_vers -productVersion set(CMAKE_OSX_ARCHITECTURES "$ENV{CMAKE_OSX_ARCHITECTURES}" CACHE STRING "Build architectures for OSX") +# macOS, iOS, tvOS, and watchOS should lookup compilers from +# Platform/Apple-${CMAKE_CXX_COMPILER_ID}-<LANG> +set(CMAKE_EFFECTIVE_SYSTEM_NAME "Apple") + #---------------------------------------------------------------------------- # _CURRENT_OSX_VERSION - as a two-component string: 10.5, 10.6, ... # diff --git a/Modules/Platform/Darwin-Intel-C.cmake b/Modules/Platform/Darwin-Intel-C.cmake deleted file mode 100644 index 81c630f..0000000 --- a/Modules/Platform/Darwin-Intel-C.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Platform/Darwin-Intel) -__darwin_compiler_intel(C) diff --git a/Modules/Platform/Darwin-Intel-CXX.cmake b/Modules/Platform/Darwin-Intel-CXX.cmake deleted file mode 100644 index 90ae53b..0000000 --- a/Modules/Platform/Darwin-Intel-CXX.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Platform/Darwin-Intel) -__darwin_compiler_intel(CXX) diff --git a/Modules/Platform/Darwin-PGI-C.cmake b/Modules/Platform/Darwin-PGI-C.cmake deleted file mode 100644 index 790919b..0000000 --- a/Modules/Platform/Darwin-PGI-C.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Platform/Darwin-PGI) -__darwin_compiler_pgi(C) diff --git a/Modules/Platform/Darwin-PGI-CXX.cmake b/Modules/Platform/Darwin-PGI-CXX.cmake deleted file mode 100644 index ceaed71..0000000 --- a/Modules/Platform/Darwin-PGI-CXX.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Platform/Darwin-PGI) -__darwin_compiler_pgi(CXX) diff --git a/Modules/Platform/Darwin-PGI-Fortran.cmake b/Modules/Platform/Darwin-PGI-Fortran.cmake deleted file mode 100644 index 146807b..0000000 --- a/Modules/Platform/Darwin-PGI-Fortran.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(Platform/Darwin-PGI) -__darwin_compiler_pgi(Fortran) diff --git a/Modules/Platform/Darwin-VisualAge-C.cmake b/Modules/Platform/Darwin-VisualAge-C.cmake deleted file mode 100644 index 859914f..0000000 --- a/Modules/Platform/Darwin-VisualAge-C.cmake +++ /dev/null @@ -1 +0,0 @@ -include(Platform/Darwin-XL-C) diff --git a/Modules/Platform/Darwin-VisualAge-CXX.cmake b/Modules/Platform/Darwin-VisualAge-CXX.cmake deleted file mode 100644 index 46c1005..0000000 --- a/Modules/Platform/Darwin-VisualAge-CXX.cmake +++ /dev/null @@ -1 +0,0 @@ -include(Platform/Darwin-XL-CXX) |