diff options
author | Raul Tambre <raul@tambre.ee> | 2023-05-08 17:26:39 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2023-05-08 17:26:39 (GMT) |
commit | eacacc70fcf3bd320d9a05d180a0408b3429d2b9 (patch) | |
tree | 070d272704ad610f5e70c561a067e78bdff30c61 /Modules | |
parent | b2d689bc5abf027e6650cb8d68c9859249a0ea6f (diff) | |
download | CMake-eacacc70fcf3bd320d9a05d180a0408b3429d2b9.zip CMake-eacacc70fcf3bd320d9a05d180a0408b3429d2b9.tar.gz CMake-eacacc70fcf3bd320d9a05d180a0408b3429d2b9.tar.bz2 |
Clang: use -std=c++23 for Clang 17.0+
Canonical flag changed in LLVM commit ba15d186e5cef2620d562c6c9d9a6d570382cd0a.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/Clang.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 6c544fd..a21ba43 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -173,7 +173,10 @@ macro(__compiler_clang_cxx_standards lang) unset(_clang_version_std17) - if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0) + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 17.0) + set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++23") + set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++23") + elseif(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() |