diff options
author | Brad King <brad.king@kitware.com> | 2023-08-16 13:43:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-08-16 13:44:48 (GMT) |
commit | 04f2c4b1990859676dc2f7f6f72c4b6b2065c644 (patch) | |
tree | 014fd97fad9d07a9f4cf9b071c42b896a28d23b9 /Modules | |
parent | 56a9c6e27e361d0ca1b70342e1415d09e3a31356 (diff) | |
parent | 65288eb92a4f0753340df11acb55134d603663d1 (diff) | |
download | CMake-04f2c4b1990859676dc2f7f6f72c4b6b2065c644.zip CMake-04f2c4b1990859676dc2f7f6f72c4b6b2065c644.tar.gz CMake-04f2c4b1990859676dc2f7f6f72c4b6b2065c644.tar.bz2 |
Merge topic 'clang_c23'
65288eb92a Clang: use -std=c23 for Clang 18+
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8716
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index 1b765ad..480a5de 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -48,7 +48,10 @@ if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17") endif() - if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0) + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0) + set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c23") + set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu23") + elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0) set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x") set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x") endif() |