summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompileFeatures.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-26 15:55:15 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-27 11:40:54 (GMT)
commit7fe580a36253281784dda9c35798693350e24859 (patch)
treeed860d357022a6c8db6f1daead9e27e7970ec1b9 /Modules/CMakeDetermineCompileFeatures.cmake
parent1b328e09a33e61293635c7ddb9bcff986ae8d1e7 (diff)
downloadCMake-7fe580a36253281784dda9c35798693350e24859.zip
CMake-7fe580a36253281784dda9c35798693350e24859.tar.gz
CMake-7fe580a36253281784dda9c35798693350e24859.tar.bz2
Features: Add infrastructure for C++ 20 language standard
Issue: #17849
Diffstat (limited to 'Modules/CMakeDetermineCompileFeatures.cmake')
-rw-r--r--Modules/CMakeDetermineCompileFeatures.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
index 3ed92be..01a81a1 100644
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ b/Modules/CMakeDetermineCompileFeatures.cmake
@@ -49,6 +49,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CXX11_COMPILE_FEATURES)
set(CMAKE_CXX14_COMPILE_FEATURES)
set(CMAKE_CXX17_COMPILE_FEATURES)
+ set(CMAKE_CXX20_COMPILE_FEATURES)
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -59,6 +60,9 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_CXX17_COMPILE_FEATURES AND CMAKE_CXX20_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES})
+ endif()
if (CMAKE_CXX14_COMPILE_FEATURES AND CMAKE_CXX17_COMPILE_FEATURES)
list(REMOVE_ITEM CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX14_COMPILE_FEATURES})
endif()
@@ -75,6 +79,7 @@ function(cmake_determine_compile_features lang)
${CMAKE_CXX11_COMPILE_FEATURES}
${CMAKE_CXX14_COMPILE_FEATURES}
${CMAKE_CXX17_COMPILE_FEATURES}
+ ${CMAKE_CXX20_COMPILE_FEATURES}
)
endif()
@@ -83,6 +88,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX14_COMPILE_FEATURES ${CMAKE_CXX14_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES} PARENT_SCOPE)
message(STATUS "Detecting ${lang} compile features - done")
endif()