diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-10 20:39:53 (GMT) |
---|---|---|
committer | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-30 13:34:36 (GMT) |
commit | 9b112a848a2063c81fe758984351d765e712a2bc (patch) | |
tree | 6a7021a51fe474418e1e132de7b58095d7936e74 | |
parent | 37221529c7d032599cd7f8a4bb6778a55b8bc5a8 (diff) | |
download | CMake-9b112a848a2063c81fe758984351d765e712a2bc.zip CMake-9b112a848a2063c81fe758984351d765e712a2bc.tar.gz CMake-9b112a848a2063c81fe758984351d765e712a2bc.tar.bz2 |
Compilers: Port to use default cmake_record_lang_compile_features macros
-rw-r--r-- | Modules/Compiler/AppleClang-C.cmake | 15 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-CXX.cmake | 18 | ||||
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 15 | ||||
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 18 | ||||
-rw-r--r-- | Modules/Compiler/GNU-C.cmake | 15 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 18 | ||||
-rw-r--r-- | Modules/Compiler/Intel-C.cmake | 15 | ||||
-rw-r--r-- | Modules/Compiler/Intel-CXX.cmake | 18 | ||||
-rw-r--r-- | Modules/Compiler/MSVC-CXX.cmake | 14 | ||||
-rw-r--r-- | Modules/Compiler/SunPro-C.cmake | 15 | ||||
-rw-r--r-- | Modules/Compiler/SunPro-CXX.cmake | 12 |
11 files changed, 2 insertions, 171 deletions
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index c18f541..a48adec 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -13,18 +13,3 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) endif() __compiler_check_default_language_standard(C 4.0 99) - -macro(cmake_record_c_compile_features) - set(_result 0) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) - if (_result EQUAL 0) - _record_compiler_features_c(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(99) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(90) - endif() - endif() -endmacro() diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 904d965..e5fd647 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -28,21 +28,3 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1) endif() __compiler_check_default_language_standard(CXX 4.0 98) - -macro(cmake_record_cxx_compile_features) - set(_result 0) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) - if(_result EQUAL 0 AND CMAKE_CXX17_STANDARD_COMPILE_OPTION) - _record_compiler_features_cxx(17) - endif() - if(_result EQUAL 0 AND CMAKE_CXX14_STANDARD_COMPILE_OPTION) - _record_compiler_features_cxx(14) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(98) - endif() - endif() -endmacro() diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index b94087f..b881e2b 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -18,18 +18,3 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) endif() __compiler_check_default_language_standard(C 3.4 99 3.6 11) - -macro(cmake_record_c_compile_features) - set(_result 0) - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) - if (_result EQUAL 0) - _record_compiler_features_c(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(99) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(90) - endif() - endif() -endmacro() diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 5904efa..ff041ab 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -37,21 +37,3 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) endif() __compiler_check_default_language_standard(CXX 3.1 98) - -macro(cmake_record_cxx_compile_features) - set(_result 0) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1) - if(_result EQUAL 0 AND CMAKE_CXX17_STANDARD_COMPILE_OPTION) - _record_compiler_features_cxx(17) - endif() - if(_result EQUAL 0 AND CMAKE_CXX14_STANDARD_COMPILE_OPTION) - _record_compiler_features_cxx(14) - endif() - if (_result EQUAL 0 AND CMAKE_CXX11_STANDARD_COMPILE_OPTION) - _record_compiler_features_cxx(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(98) - endif() - endif() -endmacro() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 8090fa6..f072c54 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -23,18 +23,3 @@ elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) endif() __compiler_check_default_language_standard(C 3.4 90 5.0 11) - -macro(cmake_record_c_compile_features) - set(_result 0) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) - if(_result EQUAL 0 AND CMAKE_C11_STANDARD_COMPILE_OPTION) - _record_compiler_features_c(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(99) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(90) - endif() - endif() -endmacro() diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index b221c4a..4b8b3c0 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -39,21 +39,3 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) endif() __compiler_check_default_language_standard(CXX 4.4 98 6.0 14) - -macro(cmake_record_cxx_compile_features) - set(_result 0) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - if(_result EQUAL 0 AND CMAKE_CXX17_STANDARD_COMPILE_OPTION) - _record_compiler_features_cxx(17) - endif() - if(_result EQUAL 0 AND CMAKE_CXX14_STANDARD_COMPILE_OPTION) - _record_compiler_features_cxx(14) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(98) - endif() - endif() -endmacro() diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 20e29e2..2e7ea24 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -39,20 +39,5 @@ endif() __compiler_check_default_language_standard(C 12.1 90 15.0.0 11) -macro(cmake_record_c_compile_features) - set(_result 0) - if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) - if (_result EQUAL 0 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) - _record_compiler_features_C(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_C(99) - endif() - if (_result EQUAL 0) - _record_compiler_features_C(90) - endif() - endif() -endmacro() - set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 08d23fc..0eb9e1f 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -56,23 +56,5 @@ endif() __compiler_check_default_language_standard(CXX 12.1 98) -macro(cmake_record_cxx_compile_features) - set(_result 0) - if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) - if (_result EQUAL 0 AND - (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0 - OR (NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" AND - NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0))) - _record_compiler_features_cxx(14) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(98) - endif() - endif() -endmacro() - set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 98b74e4..9371301 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -1,6 +1,8 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. +include(Compiler/CMakeCommonCompilerMacros) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) # MSVC has no specific options to set language standards, but set them as # empty strings anyways so the feature test infrastructure can at least check @@ -17,15 +19,3 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) # There is no meaningful default for this set(CMAKE_CXX_STANDARD_DEFAULT "") endif() - -macro(cmake_record_cxx_compile_features) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) - list(APPEND CMAKE_CXX_COMPILE_FEATURES - cxx_std_98 - cxx_std_11 - cxx_std_14 - cxx_std_17 - ) - _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) - endif() -endmacro() diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake index ac88e6f..29c2f22 100644 --- a/Modules/Compiler/SunPro-C.cmake +++ b/Modules/Compiler/SunPro-C.cmake @@ -43,20 +43,5 @@ endif() __compiler_check_default_language_standard(C 5.11 90 5.14 11) -macro(cmake_record_c_compile_features) - set(_result 0) - if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.13) - if(_result EQUAL 0 AND CMAKE_C11_STANDARD_COMPILE_OPTION) - _record_compiler_features_c(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(99) - endif() - if (_result EQUAL 0) - _record_compiler_features_c(90) - endif() - endif() -endmacro() - set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index 4b0a21d..2222b25 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -49,15 +49,3 @@ else() endif() __compiler_check_default_language_standard(CXX 5.13 98) - -macro(cmake_record_cxx_compile_features) - set(_result 0) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) - if (_result EQUAL 0) - _record_compiler_features_cxx(11) - endif() - if (_result EQUAL 0) - _record_compiler_features_cxx(98) - endif() - endif() -endmacro() |