diff options
author | Brad King <brad.king@kitware.com> | 2016-10-26 20:11:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-02 14:00:28 (GMT) |
commit | b0996a3fa223370edcdb40a1d8b66d1a3a734daf (patch) | |
tree | 9b08869843c60df30b4fec54ae9b2224c4643f5b /Modules/Compiler | |
parent | 8b6cc2518a8019314af43a32702a09bff318b777 (diff) | |
download | CMake-b0996a3fa223370edcdb40a1d8b66d1a3a734daf.zip CMake-b0996a3fa223370edcdb40a1d8b66d1a3a734daf.tar.gz CMake-b0996a3fa223370edcdb40a1d8b66d1a3a734daf.tar.bz2 |
Features: Add meta-features requesting awareness of a particular standard
A common use case of `target_compile_features` is simply to specify that
the compiler should be run in a mode that is aware of e.g. C++11. Some
projects simply specify a particular C++11-only feature to request this.
Provide a first-class way to do this by naming features after the
corresponding language standard. Record them as always available in the
corresponding standard level so that requesting them always ensures that
standard (or higher) is used.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/MSVC-CXX.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 82f15bd..f103832 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -6,6 +6,11 @@ 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 + ) _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endif() endmacro() |