summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-01 14:04:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-01 14:04:46 (GMT)
commitd10cbb05906de570f45d873296867dad4f90d93a (patch)
tree0dea89386373c9cdc21eccb0a7dc5cbca4a9e732 /Modules
parent2e86c02c244d41e768107fe1a5912af5b15b021c (diff)
parentf808d8afb9d1e6d279a92cb16242a2eea9a8c5e6 (diff)
downloadCMake-d10cbb05906de570f45d873296867dad4f90d93a.zip
CMake-d10cbb05906de570f45d873296867dad4f90d93a.tar.gz
CMake-d10cbb05906de570f45d873296867dad4f90d93a.tar.bz2
Merge topic 'add_language_levels_for_cxx26'
f808d8afb9 CMake: Support upcoming C++26 language level Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Raul Tambre <raul@tambre.ee> Merge-request: !7601
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompileFeatures.cmake19
-rw-r--r--Modules/Compiler/Clang.cmake1
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake1
3 files changed, 21 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
index a08e597..09de7b1 100644
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ b/Modules/CMakeDetermineCompileFeatures.cmake
@@ -63,6 +63,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CXX17_COMPILE_FEATURES)
set(CMAKE_CXX20_COMPILE_FEATURES)
set(CMAKE_CXX23_COMPILE_FEATURES)
+ set(CMAKE_CXX26_COMPILE_FEATURES)
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -73,6 +74,9 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_CXX23_COMPILE_FEATURES AND CMAKE_CXX26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES})
+ endif()
if (CMAKE_CXX20_COMPILE_FEATURES AND CMAKE_CXX23_COMPILE_FEATURES)
list(REMOVE_ITEM CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES})
endif()
@@ -97,6 +101,7 @@ function(cmake_determine_compile_features lang)
${CMAKE_CXX17_COMPILE_FEATURES}
${CMAKE_CXX20_COMPILE_FEATURES}
${CMAKE_CXX23_COMPILE_FEATURES}
+ ${CMAKE_CXX26_COMPILE_FEATURES}
)
endif()
@@ -107,6 +112,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX26_COMPILE_FEATURES} PARENT_SCOPE)
message(CHECK_PASS "done")
@@ -119,6 +125,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CUDA17_COMPILE_FEATURES)
set(CMAKE_CUDA20_COMPILE_FEATURES)
set(CMAKE_CUDA23_COMPILE_FEATURES)
+ set(CMAKE_CUDA26_COMPILE_FEATURES)
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -129,6 +136,9 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_CUDA23_COMPILE_FEATURES AND CMAKE_CUDA26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES})
+ endif()
if (CMAKE_CUDA20_COMPILE_FEATURES AND CMAKE_CUDA23_COMPILE_FEATURES)
list(REMOVE_ITEM CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES})
endif()
@@ -153,6 +163,7 @@ function(cmake_determine_compile_features lang)
${CMAKE_CUDA17_COMPILE_FEATURES}
${CMAKE_CUDA20_COMPILE_FEATURES}
${CMAKE_CUDA23_COMPILE_FEATURES}
+ ${CMAKE_CUDA26_COMPILE_FEATURES}
)
endif()
@@ -163,6 +174,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CUDA17_COMPILE_FEATURES ${CMAKE_CUDA17_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CUDA20_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA26_COMPILE_FEATURES} PARENT_SCOPE)
message(CHECK_PASS "done")
@@ -175,6 +187,8 @@ function(cmake_determine_compile_features lang)
set(CMAKE_HIP17_COMPILE_FEATURES)
set(CMAKE_HIP20_COMPILE_FEATURES)
set(CMAKE_HIP23_COMPILE_FEATURES)
+ set(CMAKE_HIP26_COMPILE_FEATURES)
+
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -185,6 +199,9 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_HIP23_COMPILE_FEATURES AND CMAKE_HIP26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES})
+ endif()
if (CMAKE_HIP20_COMPILE_FEATURES AND CMAKE_HIP23_COMPILE_FEATURES)
list(REMOVE_ITEM CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES})
endif()
@@ -209,6 +226,7 @@ function(cmake_determine_compile_features lang)
${CMAKE_HIP17_COMPILE_FEATURES}
${CMAKE_HIP20_COMPILE_FEATURES}
${CMAKE_HIP23_COMPILE_FEATURES}
+ ${CMAKE_HIP26_COMPILE_FEATURES}
)
endif()
@@ -219,6 +237,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP26_COMPILE_FEATURES} PARENT_SCOPE)
message(CHECK_PASS "done")
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index df115d3..257402a 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -255,6 +255,7 @@ macro(__compiler_clang_cxx_standards lang)
cxx_std_17
cxx_std_20
cxx_std_23
+ cxx_std_26
)
_record_compiler_features(${lang} "" CMAKE_${lang}_COMPILE_FEATURES)
endmacro()
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index 75165fd..60d13f1 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -72,6 +72,7 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
cxx_std_17
cxx_std_20
cxx_std_23
+ cxx_std_26
)
_record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
endmacro()