Просмотр исходного кода

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 <[email protected]>
Merge-request: !1964
Brad King 7 лет назад
Родитель
Сommit
541b53375d
43 измененных файлов с 73 добавлено и 66 удалено
  1. 4 4
      Modules/CMakeASMInformation.cmake
  2. 4 4
      Modules/CMakeCInformation.cmake
  3. 2 2
      Modules/CMakeCUDAInformation.cmake
  4. 4 4
      Modules/CMakeCXXInformation.cmake
  5. 2 0
      Modules/CMakeFindPackageMode.cmake
  6. 2 2
      Modules/CMakeFortranInformation.cmake
  7. 2 2
      Modules/CMakeLanguageInformation.cmake
  8. 2 2
      Modules/CMakeSwiftInformation.cmake
  9. 13 0
      Modules/CMakeSystemSpecificInitialize.cmake
  10. 0 0
      Modules/Platform/Apple-Absoft-Fortran.cmake
  11. 1 1
      Modules/Platform/Apple-AppleClang-C.cmake
  12. 1 1
      Modules/Platform/Apple-AppleClang-CXX.cmake
  13. 2 0
      Modules/Platform/Apple-Clang-C.cmake
  14. 2 0
      Modules/Platform/Apple-Clang-CXX.cmake
  15. 2 5
      Modules/Platform/Apple-Clang.cmake
  16. 2 2
      Modules/Platform/Apple-GNU-C.cmake
  17. 2 2
      Modules/Platform/Apple-GNU-CXX.cmake
  18. 2 2
      Modules/Platform/Apple-GNU-Fortran.cmake
  19. 2 5
      Modules/Platform/Apple-GNU.cmake
  20. 2 0
      Modules/Platform/Apple-Intel-C.cmake
  21. 2 0
      Modules/Platform/Apple-Intel-CXX.cmake
  22. 2 2
      Modules/Platform/Apple-Intel-Fortran.cmake
  23. 2 5
      Modules/Platform/Apple-Intel.cmake
  24. 0 0
      Modules/Platform/Apple-NAG-Fortran.cmake
  25. 0 0
      Modules/Platform/Apple-NVIDIA-CUDA.cmake
  26. 2 0
      Modules/Platform/Apple-PGI-C.cmake
  27. 2 0
      Modules/Platform/Apple-PGI-CXX.cmake
  28. 2 0
      Modules/Platform/Apple-PGI-Fortran.cmake
  29. 2 5
      Modules/Platform/Apple-PGI.cmake
  30. 1 0
      Modules/Platform/Apple-VisualAge-C.cmake
  31. 1 0
      Modules/Platform/Apple-VisualAge-CXX.cmake
  32. 0 0
      Modules/Platform/Apple-XL-C.cmake
  33. 0 0
      Modules/Platform/Apple-XL-CXX.cmake
  34. 0 2
      Modules/Platform/Darwin-Clang-C.cmake
  35. 0 2
      Modules/Platform/Darwin-Clang-CXX.cmake
  36. 4 0
      Modules/Platform/Darwin-Initialize.cmake
  37. 0 2
      Modules/Platform/Darwin-Intel-C.cmake
  38. 0 2
      Modules/Platform/Darwin-Intel-CXX.cmake
  39. 0 2
      Modules/Platform/Darwin-PGI-C.cmake
  40. 0 2
      Modules/Platform/Darwin-PGI-CXX.cmake
  41. 0 2
      Modules/Platform/Darwin-PGI-Fortran.cmake
  42. 0 1
      Modules/Platform/Darwin-VisualAge-C.cmake
  43. 0 1
      Modules/Platform/Darwin-VisualAge-CXX.cmake

+ 4 - 4
Modules/CMakeASMInformation.cmake

@@ -29,15 +29,15 @@ if(NOT _INCLUDED_FILE)
 endif()
 
 if(CMAKE_SYSTEM_PROCESSOR)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
   if(NOT _INCLUDED_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif()
 endif()
 
-include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
+include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
 if(NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
 endif()
 
 # This should be included before the _INIT variables are

+ 4 - 4
Modules/CMakeCInformation.cmake

@@ -35,21 +35,21 @@ endif()
 # load a hardware specific file, mostly useful for embedded compilers
 if(CMAKE_SYSTEM_PROCESSOR)
   if(CMAKE_C_COMPILER_ID)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
   endif()
   if (NOT _INCLUDED_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif ()
 endif()
 
 
 # load the system- and compiler specific files
 if(CMAKE_C_COMPILER_ID)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif()
 if (NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif ()
 

+ 2 - 2
Modules/CMakeCUDAInformation.cmake

@@ -17,9 +17,9 @@ endif()
 if(CMAKE_CUDA_COMPILER_ID)
   # load a hardware specific file, mostly useful for embedded compilers
   if(CMAKE_SYSTEM_PROCESSOR)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif()
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
 endif()
 
 

+ 4 - 4
Modules/CMakeCXXInformation.cmake

@@ -36,19 +36,19 @@ endif()
 # load a hardware specific file, mostly useful for embedded compilers
 if(CMAKE_SYSTEM_PROCESSOR)
   if(CMAKE_CXX_COMPILER_ID)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
   endif()
   if (NOT _INCLUDED_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif ()
 endif()
 
 # load the system- and compiler specific files
 if(CMAKE_CXX_COMPILER_ID)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif()
 if (NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
 endif ()
 

+ 2 - 0
Modules/CMakeFindPackageMode.cmake

@@ -65,6 +65,8 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin  AND  "${COMPILER_ID}" MATCHES GNU)
   set(CMAKE_${LANGUAGE}_OSX_DEPLOYMENT_TARGET_FLAG "")
 endif()
 
+include(CMakeSystemSpecificInitialize)
+
 # Also load the system specific file, which sets up e.g. the search paths.
 # This makes the FIND_XXX() calls work much better
 include(CMakeSystemSpecificInformation)

+ 2 - 2
Modules/CMakeFortranInformation.cmake

@@ -22,10 +22,10 @@ if(CMAKE_COMPILER_IS_GNUG77)
   set(CMAKE_BASE_NAME g77)
 endif()
 if(CMAKE_Fortran_COMPILER_ID)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif()
 if (NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
 endif ()
 

+ 2 - 2
Modules/CMakeLanguageInformation.cmake

@@ -9,10 +9,10 @@
 macro(__cmake_include_compiler_wrapper lang)
   set(_INCLUDED_WRAPPER_FILE 0)
   if (CMAKE_${lang}_COMPILER_ID)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
   endif()
   if (NOT _INCLUDED_WRAPPER_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
   endif ()
 
   # No platform - wrapper - lang information so maybe there's just wrapper - lang information

+ 2 - 2
Modules/CMakeSwiftInformation.cmake

@@ -14,9 +14,9 @@ endif()
 if(CMAKE_Swift_COMPILER_ID)
   # load a hardware specific file, mostly useful for embedded compilers
   if(CMAKE_SYSTEM_PROCESSOR)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif()
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL)
 endif()
 
 # for most systems a module is the same as a shared library

+ 13 - 0
Modules/CMakeSystemSpecificInitialize.cmake

@@ -5,6 +5,19 @@
 # This file is included by cmGlobalGenerator::EnableLanguage.
 # It is included before the compiler has been determined.
 
+# The CMAKE_EFFECTIVE_SYSTEM_NAME is used to load compiler and compiler
+# wrapper configuration files. By default it equals to CMAKE_SYSTEM_NAME
+# but could be overridden in the ${CMAKE_SYSTEM_NAME}-Initialize files.
+#
+# It is useful to share the same aforementioned configuration files and
+# avoids duplicating them in case of tightly related platforms.
+#
+# An example are the platforms supported by Xcode (macOS, iOS, tvOS,
+# and watchOS). For all of those the CMAKE_EFFECTIVE_SYSTEM_NAME is
+# set to Apple which results in using
+# Platfom/Apple-AppleClang-CXX.cmake for the Apple C++ compiler.
+set(CMAKE_EFFECTIVE_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
+
 include(Platform/${CMAKE_SYSTEM_NAME}-Initialize OPTIONAL)
 
 set(CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED 1)

+ 0 - 0
Modules/Platform/Darwin-Absoft-Fortran.cmake → Modules/Platform/Apple-Absoft-Fortran.cmake


+ 1 - 1
Modules/Platform/Darwin-AppleClang-C.cmake → 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()

+ 1 - 1
Modules/Platform/Darwin-AppleClang-CXX.cmake → 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()

+ 2 - 0
Modules/Platform/Apple-Clang-C.cmake

@@ -0,0 +1,2 @@
+include(Platform/Apple-Clang)
+__apple_compiler_clang(C)

+ 2 - 0
Modules/Platform/Apple-Clang-CXX.cmake

@@ -0,0 +1,2 @@
+include(Platform/Apple-Clang)
+__apple_compiler_clang(CXX)

+ 2 - 5
Modules/Platform/Darwin-Clang.cmake → 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")

+ 2 - 2
Modules/Platform/Darwin-GNU-C.cmake → 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)

+ 2 - 2
Modules/Platform/Darwin-GNU-CXX.cmake → 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)

+ 2 - 2
Modules/Platform/Darwin-GNU-Fortran.cmake → 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)
 

+ 2 - 5
Modules/Platform/Darwin-GNU.cmake → 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")

+ 2 - 0
Modules/Platform/Apple-Intel-C.cmake

@@ -0,0 +1,2 @@
+include(Platform/Apple-Intel)
+__apple_compiler_intel(C)

+ 2 - 0
Modules/Platform/Apple-Intel-CXX.cmake

@@ -0,0 +1,2 @@
+include(Platform/Apple-Intel)
+__apple_compiler_intel(CXX)

+ 2 - 2
Modules/Platform/Darwin-Intel-Fortran.cmake → 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 ")

+ 2 - 5
Modules/Platform/Darwin-Intel.cmake → 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")

+ 0 - 0
Modules/Platform/Darwin-NAG-Fortran.cmake → Modules/Platform/Apple-NAG-Fortran.cmake


+ 0 - 0
Modules/Platform/Darwin-NVIDIA-CUDA.cmake → Modules/Platform/Apple-NVIDIA-CUDA.cmake


+ 2 - 0
Modules/Platform/Apple-PGI-C.cmake

@@ -0,0 +1,2 @@
+include(Platform/Apple-PGI)
+__apple_compiler_pgi(C)

+ 2 - 0
Modules/Platform/Apple-PGI-CXX.cmake

@@ -0,0 +1,2 @@
+include(Platform/Apple-PGI)
+__apple_compiler_pgi(CXX)

+ 2 - 0
Modules/Platform/Apple-PGI-Fortran.cmake

@@ -0,0 +1,2 @@
+include(Platform/Apple-PGI)
+__apple_compiler_pgi(Fortran)

+ 2 - 5
Modules/Platform/Darwin-PGI.cmake → 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")

+ 1 - 0
Modules/Platform/Apple-VisualAge-C.cmake

@@ -0,0 +1 @@
+include(Platform/Apple-XL-C)

+ 1 - 0
Modules/Platform/Apple-VisualAge-CXX.cmake

@@ -0,0 +1 @@
+include(Platform/Apple-XL-CXX)

+ 0 - 0
Modules/Platform/Darwin-XL-C.cmake → Modules/Platform/Apple-XL-C.cmake


+ 0 - 0
Modules/Platform/Darwin-XL-CXX.cmake → Modules/Platform/Apple-XL-CXX.cmake


+ 0 - 2
Modules/Platform/Darwin-Clang-C.cmake

@@ -1,2 +0,0 @@
-include(Platform/Darwin-Clang)
-__darwin_compiler_clang(C)

+ 0 - 2
Modules/Platform/Darwin-Clang-CXX.cmake

@@ -1,2 +0,0 @@
-include(Platform/Darwin-Clang)
-__darwin_compiler_clang(CXX)

+ 4 - 0
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, ...
 #

+ 0 - 2
Modules/Platform/Darwin-Intel-C.cmake

@@ -1,2 +0,0 @@
-include(Platform/Darwin-Intel)
-__darwin_compiler_intel(C)

+ 0 - 2
Modules/Platform/Darwin-Intel-CXX.cmake

@@ -1,2 +0,0 @@
-include(Platform/Darwin-Intel)
-__darwin_compiler_intel(CXX)

+ 0 - 2
Modules/Platform/Darwin-PGI-C.cmake

@@ -1,2 +0,0 @@
-include(Platform/Darwin-PGI)
-__darwin_compiler_pgi(C)

+ 0 - 2
Modules/Platform/Darwin-PGI-CXX.cmake

@@ -1,2 +0,0 @@
-include(Platform/Darwin-PGI)
-__darwin_compiler_pgi(CXX)

+ 0 - 2
Modules/Platform/Darwin-PGI-Fortran.cmake

@@ -1,2 +0,0 @@
-include(Platform/Darwin-PGI)
-__darwin_compiler_pgi(Fortran)

+ 0 - 1
Modules/Platform/Darwin-VisualAge-C.cmake

@@ -1 +0,0 @@
-include(Platform/Darwin-XL-C)

+ 0 - 1
Modules/Platform/Darwin-VisualAge-CXX.cmake

@@ -1 +0,0 @@
-include(Platform/Darwin-XL-CXX)