project: Add infrastructure for recording CXX compiler features

Add a feature test using the compiler macros and the preprocessor to
determine available features.

Add a CMAKE_CXX_COMPILE_FEATURES variable which contains all features
known to the loaded compiler, and a CMAKE_CXX_KNOWN_FEATURES variable
containing all features known to CMake.  Add language standard specific
variables for internal use to determine the standard-specific compile
flags to use.

This will be extended to other languages in the future.  Follow-up
commits will add features which will be recorded by the feature test.
This commit is contained in:
Stephen Kelly
2013-10-17 11:47:29 +02:00
parent 913394af24
commit faeddf64f2
7 changed files with 124 additions and 0 deletions
+2
View File
@@ -257,6 +257,8 @@ Variables for Languages
:maxdepth: 1
/variable/CMAKE_COMPILER_IS_GNULANG
/variable/CMAKE_CXX_COMPILE_FEATURES
/variable/CMAKE_CXX_KNOWN_FEATURES
/variable/CMAKE_CXX_STANDARD
/variable/CMAKE_CXX_EXTENSIONS
/variable/CMAKE_Fortran_MODDIR_DEFAULT
@@ -0,0 +1,8 @@
CMAKE_CXX_COMPILE_FEATURES
--------------------------
List of features known to the C++ compiler
These features are known to be available for use with the C++ compiler. This
list is a subset of the features listed in the :variable:`CMAKE_CXX_KNOWN_FEATURES`
variable.
@@ -0,0 +1,8 @@
CMAKE_CXX_KNOWN_FEATURES
------------------------
List of C++ features known to this version of CMake.
The features listed in this variable may be known to be available to the
C++ compiler. If the feature is available with the C++ compiler, it will
be listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable.