diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-10 20:20:10 (GMT) |
---|---|---|
committer | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-29 16:33:42 (GMT) |
commit | 5bb7429166240ffaf6f53f834bbb1a4973df8e1d (patch) | |
tree | 5c3cc32701f08c86f32f79b1a3c6fce83e64bf1c /Modules/Compiler | |
parent | e75ac5aa03934d259adf5d9300c24539161131af (diff) | |
download | CMake-5bb7429166240ffaf6f53f834bbb1a4973df8e1d.zip CMake-5bb7429166240ffaf6f53f834bbb1a4973df8e1d.tar.gz CMake-5bb7429166240ffaf6f53f834bbb1a4973df8e1d.tar.bz2 |
Compilers: Add default cmake_record_{c,cxx}_compile_features macros
Add default implementations for the cmake_record_lang_compile_features
macros. All implementations of this are the same so it can be safely
factored out to a common implementation.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/CMakeCommonCompilerMacros.cmake | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Modules/Compiler/CMakeCommonCompilerMacros.cmake b/Modules/Compiler/CMakeCommonCompilerMacros.cmake index cb365d6..684fd30 100644 --- a/Modules/Compiler/CMakeCommonCompilerMacros.cmake +++ b/Modules/Compiler/CMakeCommonCompilerMacros.cmake @@ -60,3 +60,34 @@ macro(__compiler_check_default_language_standard lang stdver1 std1) endif () unset(__std_ver_pairs) endmacro() + +# Define to allow compile features to be automatically determined +macro(cmake_record_c_compile_features) + set(_result 0) + if(_result EQUAL 0 AND DEFINED CMAKE_C11_STANDARD_COMPILE_OPTION) + _record_compiler_features_c(11) + endif() + if(_result EQUAL 0 AND DEFINED CMAKE_C99_STANDARD_COMPILE_OPTION) + _record_compiler_features_c(99) + endif() + if(_result EQUAL 0 AND DEFINED CMAKE_C90_STANDARD_COMPILE_OPTION) + _record_compiler_features_c(90) + endif() +endmacro() + +# Define to allow compile features to be automatically determined +macro(cmake_record_cxx_compile_features) + set(_result 0) + if(_result EQUAL 0 AND DEFINED CMAKE_CXX17_STANDARD_COMPILE_OPTION) + _record_compiler_features_cxx(17) + endif() + if(_result EQUAL 0 AND DEFINED CMAKE_CXX14_STANDARD_COMPILE_OPTION) + _record_compiler_features_cxx(14) + endif() + if(_result EQUAL 0 AND DEFINED CMAKE_CXX11_STANDARD_COMPILE_OPTION) + _record_compiler_features_cxx(11) + endif() + if(_result EQUAL 0 AND DEFINED CMAKE_CXX98_STANDARD_COMPILE_OPTION) + _record_compiler_features_cxx(98) + endif() +endmacro() |