summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang.cmake
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-12-04 15:46:07 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-12-08 16:43:59 (GMT)
commit9f3c70a333f076aca61affff189232edaba89c38 (patch)
tree3a484b6802c039c2ec1922f95c5dee50d8fccd65 /Modules/Compiler/Clang.cmake
parentaf7e1545c8219c6eebaff6272955e8cd99d175a5 (diff)
downloadCMake-9f3c70a333f076aca61affff189232edaba89c38.zip
CMake-9f3c70a333f076aca61affff189232edaba89c38.tar.gz
CMake-9f3c70a333f076aca61affff189232edaba89c38.tar.bz2
CUDA, CXX, OBJCXX: C++23 support with Clang 12
Clang 12 landed initial support for C++23 language mode flag -std={c|gnu}++2b in commit 6627a3c2873fdf7ccba1a1573371079be48b36e8.
Diffstat (limited to 'Modules/Compiler/Clang.cmake')
-rw-r--r--Modules/Compiler/Clang.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 0e4cded..9f900df 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -165,6 +165,11 @@ macro(__compiler_clang_cxx_standards lang)
unset(_clang_version_std17)
+ if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0)
+ set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++2b")
+ set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++2b")
+ endif()
+
if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC")
# The MSVC standard library requires C++14, and MSVC itself has no
# notion of operating in a mode not aware of at least that standard.
@@ -215,6 +220,8 @@ macro(__compiler_clang_cxx_standards lang)
set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "")
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "")
# There is no meaningful default for this
set(CMAKE_${lang}_STANDARD_DEFAULT "")
@@ -230,6 +237,7 @@ macro(__compiler_clang_cxx_standards lang)
cxx_std_14
cxx_std_17
cxx_std_20
+ cxx_std_23
)
_record_compiler_features(${lang} "" CMAKE_${lang}_COMPILE_FEATURES)
endmacro()