diff options
-rw-r--r-- | Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst | 5 | ||||
-rw-r--r-- | Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 5 | ||||
-rw-r--r-- | Help/prop_tgt/CUDA_STANDARD.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/CXX_STANDARD.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/HIP_STANDARD.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/OBJCXX_STANDARD.rst | 6 | ||||
-rw-r--r-- | Help/release/dev/cxx_std_26.rst | 8 | ||||
-rw-r--r-- | Modules/CMakeDetermineCompileFeatures.cmake | 19 | ||||
-rw-r--r-- | Modules/Compiler/Clang.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/MSVC-CXX.cmake | 1 | ||||
-rw-r--r-- | Source/cmStandardLevelResolver.cxx | 28 | ||||
-rw-r--r-- | Source/cmake.h | 7 | ||||
-rw-r--r-- | Tests/CompileFeatures/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/CompileFeatures/genex_test.cpp | 3 |
14 files changed, 88 insertions, 14 deletions
diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst index d93a9c1..a31ee3a 100644 --- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst @@ -36,4 +36,9 @@ The features known to this version of CMake are: Compiler mode is at least CUDA/C++ 23. +``cuda_std_26`` + .. versionadded:: 3.25 + + Compiler mode is at least CUDA/C++ 26. + .. include:: CMAKE_LANG_STD_FLAGS.txt diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index 6846850..3832f1a 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -46,6 +46,11 @@ but it does not necessarily imply complete conformance to that standard. Compiler mode is at least C++ 23. +``cxx_std_26`` + .. versionadded:: 3.25 + + Compiler mode is at least C++ 26. + .. include:: CMAKE_LANG_STD_FLAGS.txt Low level individual compile features diff --git a/Help/prop_tgt/CUDA_STANDARD.rst b/Help/prop_tgt/CUDA_STANDARD.rst index 950ba12..ada69b9 100644 --- a/Help/prop_tgt/CUDA_STANDARD.rst +++ b/Help/prop_tgt/CUDA_STANDARD.rst @@ -39,6 +39,12 @@ Supported values are: CUDA C++23 +``26`` + .. versionadded:: 3.25 + + CUDA C++26. CMake 3.25 and later *recognize* ``26`` as a valid value, + no version has support for any compiler. + If the value requested does not result in a compile flag being added for the compiler in use, a previous standard flag will be added instead. This means that using: diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index b10d201..9b381e4 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -37,6 +37,12 @@ Supported values are: C++23 +``26`` + .. versionadded:: 3.25 + + C++26. CMake 3.25 and later *recognize* ``26`` as a valid value, + no version has support for any compiler. + If the value requested does not result in a compile flag being added for the compiler in use, a previous standard flag will be added instead. This means that using: diff --git a/Help/prop_tgt/HIP_STANDARD.rst b/Help/prop_tgt/HIP_STANDARD.rst index 0c767c6..9de8730 100644 --- a/Help/prop_tgt/HIP_STANDARD.rst +++ b/Help/prop_tgt/HIP_STANDARD.rst @@ -25,6 +25,12 @@ Supported values are: ``23`` HIP C++23 +``26`` + .. versionadded:: 3.25 + + HIP C++26. CMake 3.25 and later *recognize* ``26`` as a valid value, + no version has support for any compiler. + If the value requested does not result in a compile flag being added for the compiler in use, a previous standard flag will be added instead. This means that using: diff --git a/Help/prop_tgt/OBJCXX_STANDARD.rst b/Help/prop_tgt/OBJCXX_STANDARD.rst index 654e687..6ac8216 100644 --- a/Help/prop_tgt/OBJCXX_STANDARD.rst +++ b/Help/prop_tgt/OBJCXX_STANDARD.rst @@ -31,6 +31,12 @@ Supported values are: Objective C++23 +``26`` + .. versionadded:: 3.25 + + Objective C++26. CMake 3.25 and later *recognize* ``26`` as a valid value, + no version has support for any compiler. + If the value requested does not result in a compile flag being added for the compiler in use, a previous standard flag will be added instead. This means that using: diff --git a/Help/release/dev/cxx_std_26.rst b/Help/release/dev/cxx_std_26.rst new file mode 100644 index 0000000..831f567 --- /dev/null +++ b/Help/release/dev/cxx_std_26.rst @@ -0,0 +1,8 @@ +cxx_std_26 +---------- + +* C++26 compiler modes may now be specified via the :prop_tgt:`CXX_STANDARD`, + :prop_tgt:`CUDA_STANDARD`, :prop_tgt:`HIP_STANDARD`, or + :prop_tgt:`OBJCXX_STANDARD` target properties, + or via the :manual:`Compile Features <cmake-compile-features(7)>` + functionality's ``cxx_std_26`` meta-feature. 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() diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx index 785f356..a2ad402 100644 --- a/Source/cmStandardLevelResolver.cxx +++ b/Source/cmStandardLevelResolver.cxx @@ -378,25 +378,29 @@ std::unordered_map<std::string, StandardLevelComputer> "C", std::vector<int>{ 90, 99, 11, 17, 23 }, std::vector<std::string>{ "90", "99", "11", "17", "23" } } }, { "CXX", - StandardLevelComputer{ - "CXX", std::vector<int>{ 98, 11, 14, 17, 20, 23 }, - std::vector<std::string>{ "98", "11", "14", "17", "20", "23" } } }, + StandardLevelComputer{ "CXX", + std::vector<int>{ 98, 11, 14, 17, 20, 23, 26 }, + std::vector<std::string>{ "98", "11", "14", "17", + "20", "23", "26" } } }, { "CUDA", - StandardLevelComputer{ - "CUDA", std::vector<int>{ 03, 11, 14, 17, 20, 23 }, - std::vector<std::string>{ "03", "11", "14", "17", "20", "23" } } }, + StandardLevelComputer{ "CUDA", + std::vector<int>{ 03, 11, 14, 17, 20, 23, 26 }, + std::vector<std::string>{ "03", "11", "14", "17", + "20", "23", "26" } } }, { "OBJC", StandardLevelComputer{ "OBJC", std::vector<int>{ 90, 99, 11, 17, 23 }, std::vector<std::string>{ "90", "99", "11", "17", "23" } } }, { "OBJCXX", - StandardLevelComputer{ - "OBJCXX", std::vector<int>{ 98, 11, 14, 17, 20, 23 }, - std::vector<std::string>{ "98", "11", "14", "17", "20", "23" } } }, + StandardLevelComputer{ "OBJCXX", + std::vector<int>{ 98, 11, 14, 17, 20, 23, 26 }, + std::vector<std::string>{ "98", "11", "14", "17", + "20", "23", "26" } } }, { "HIP", - StandardLevelComputer{ - "HIP", std::vector<int>{ 98, 11, 14, 17, 20, 23 }, - std::vector<std::string>{ "98", "11", "14", "17", "20", "23" } } } + StandardLevelComputer{ "HIP", + std::vector<int>{ 98, 11, 14, 17, 20, 23, 26 }, + std::vector<std::string>{ "98", "11", "14", "17", + "20", "23", "26" } } } }; } diff --git a/Source/cmake.h b/Source/cmake.h index a631647..8c0fece 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -861,6 +861,7 @@ private: F(cxx_std_17) \ F(cxx_std_20) \ F(cxx_std_23) \ + F(cxx_std_26) \ FOR_EACH_CXX98_FEATURE(F) \ FOR_EACH_CXX11_FEATURE(F) \ FOR_EACH_CXX14_FEATURE(F) @@ -871,7 +872,8 @@ private: F(cuda_std_14) \ F(cuda_std_17) \ F(cuda_std_20) \ - F(cuda_std_23) + F(cuda_std_23) \ + F(cuda_std_26) #define FOR_EACH_HIP_FEATURE(F) \ F(hip_std_98) \ @@ -879,4 +881,5 @@ private: F(hip_std_14) \ F(hip_std_17) \ F(hip_std_20) \ - F(hip_std_23) + F(hip_std_23) \ + F(hip_std_26) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index c6d1e8a..f3d3a73 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -356,6 +356,7 @@ else() HAVE_CXX_STD_17=$<COMPILE_FEATURES:cxx_std_17> HAVE_CXX_STD_20=$<COMPILE_FEATURES:cxx_std_20> HAVE_CXX_STD_23=$<COMPILE_FEATURES:cxx_std_23> + HAVE_CXX_STD_26=$<COMPILE_FEATURES:cxx_std_26> ) endif() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 9c3910e..048f3de 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -27,6 +27,9 @@ # if HAVE_CXX_STD_23 && !defined(ALLOW_LATER_STANDARDS) # error HAVE_CXX_STD_23 is true with CXX_STANDARD == 11 # endif +# if HAVE_CXX_STD_26 && !defined(ALLOW_LATER_STANDARDS) +# error HAVE_CXX_STD_26 is true with CXX_STANDARD == 11 +# endif #endif #if !HAVE_OVERRIDE_CONTROL |