diff options
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index e620d7c..363a8c3 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -67,7 +67,7 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0) endif() if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") - __compiler_check_default_language_standard(C 2.1 99 3.5.2 11) + __compiler_check_default_language_standard(C 2.1 99 3.5.2 11 11.0 17) else() set(CMAKE_C_STANDARD_DEFAULT "") endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 5f8ff42..354a04e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -420,7 +420,9 @@ function(add_RunCMake_test_try_compile) if(CMAKE_VERSION VERSION_LESS 3.20.20210225 AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang") # Older CMake versions do not know about Clang MSVC compatibility mode # standards. Approximate the logic from Clang-C.cmake. - if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5.2) + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0) + set(CMAKE_C_STANDARD_DEFAULT 17) + elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5.2) set(CMAKE_C_STANDARD_DEFAULT 11) endif() endif() |