diff options
author | Raul Tambre <raul@tambre.ee> | 2021-02-06 16:20:19 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-02-25 16:22:10 (GMT) |
commit | 9024fb632eb236727d057f6d9f98e2b3b30df212 (patch) | |
tree | 1f6ee3202319bf022c86a85e6ba1bfcc7a7ee095 | |
parent | dcd599757f215fa8eba3b5e40d4b1c52eb5b3919 (diff) | |
download | CMake-9024fb632eb236727d057f6d9f98e2b3b30df212.zip CMake-9024fb632eb236727d057f6d9f98e2b3b30df212.tar.gz CMake-9024fb632eb236727d057f6d9f98e2b3b30df212.tar.bz2 |
Clang: C17 support
Added in LLVM commit 5b6c0f75e01571851b767dc63a3229c962f464f1, available since
Clang 6.
Issue: #17755
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index dc472d4..e620d7c 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -41,6 +41,11 @@ if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() + + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) + set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17") + set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17") + endif() else() set(CMAKE_C90_STANDARD_COMPILE_OPTION "") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "") @@ -48,6 +53,8 @@ else() set(CMAKE_C99_EXTENSION_COMPILE_OPTION "") set(CMAKE_C11_STANDARD_COMPILE_OPTION "") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "") + set(CMAKE_C17_STANDARD_COMPILE_OPTION "") + set(CMAKE_C17_EXTENSION_COMPILE_OPTION "") endif() if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 2.1) |