Browse Source

Compilers: Port to use default cmake_record_lang_compile_features macros

Chuck Atkins 8 years ago
parent
commit
9b112a848a

+ 0 - 15
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()

+ 0 - 18
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()

+ 0 - 15
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()

+ 0 - 18
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()

+ 0 - 15
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()

+ 0 - 18
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()

+ 0 - 15
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>")

+ 0 - 18
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>")

+ 2 - 12
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()

+ 0 - 15
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>")

+ 0 - 12
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()