summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2021-02-06 16:25:47 (GMT)
committerRaul Tambre <raul@tambre.ee>2021-02-25 16:22:29 (GMT)
commit82239d43f8020cb50f03bf658e97c81afb611b9a (patch)
tree918b8e58ac624806776275f3cca55855fa17385f
parent9024fb632eb236727d057f6d9f98e2b3b30df212 (diff)
downloadCMake-82239d43f8020cb50f03bf658e97c81afb611b9a.zip
CMake-82239d43f8020cb50f03bf658e97c81afb611b9a.tar.gz
CMake-82239d43f8020cb50f03bf658e97c81afb611b9a.tar.bz2
Clang: C17 default version
Switched in LLVM commit 91cdbd521a38495c66e30636943563ca70d3c022, released in Clang 11. Issue: #17755
-rw-r--r--Modules/Compiler/Clang-C.cmake2
-rw-r--r--Tests/RunCMake/CMakeLists.txt4
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()