summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/GNU-CXX.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-02 13:34:16 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-07 16:11:18 (GMT)
commitf97bf4370c283432c4e14fe54ed481d5d9b7ceef (patch)
tree6964c99045b0345b32e45ad1bb374fc75c2a6292 /Modules/Compiler/GNU-CXX.cmake
parent03355d6b5b382020e7dafb28605e6d8d2f20de3c (diff)
downloadCMake-f97bf4370c283432c4e14fe54ed481d5d9b7ceef.zip
CMake-f97bf4370c283432c4e14fe54ed481d5d9b7ceef.tar.gz
CMake-f97bf4370c283432c4e14fe54ed481d5d9b7ceef.tar.bz2
Features: Add cxx_auto_type.
Record the availability of this feature for GNU 4.8 on (UNIX AND NOT APPLE) only. In the future, availability can be recorded for earlier GNU, for other platforms and for other compilers. Initially the affected configurations are as restricted as possible to allow for easy testing while extending the features vector in only one dimension. The error message when using the set_property API directly is not very good, but follow up commits will provide origin debugging of the property and a target_compile_features command which will provide a configure-time backtrace when possible.
Diffstat (limited to 'Modules/Compiler/GNU-CXX.cmake')
-rw-r--r--Modules/Compiler/GNU-CXX.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 3ee8639..7acad52 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -23,3 +23,15 @@ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
endif()
+
+macro(cmake_record_cxx_compile_features)
+ macro(_get_gcc_features std_version list)
+ record_compiler_features(CXX "-std=${std_version}" ${list})
+ endmacro()
+
+ if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
+ _get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES)
+ else()
+ set(_result 0)
+ endif()
+endmacro()