summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-15 13:01:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-15 13:01:44 (GMT)
commit8e61ebb75e8c1063e89518e3154a4b80381ed800 (patch)
tree7b063735a02e273de8b74b71afef58b7f0530afc
parentca727a5ff1dbf79b0cb47b5ae3efd6b14a434e55 (diff)
parentb365385d669d1a04cbc677cf2c7130c03bdea7e3 (diff)
downloadCMake-8e61ebb75e8c1063e89518e3154a4b80381ed800.zip
CMake-8e61ebb75e8c1063e89518e3154a4b80381ed800.tar.gz
CMake-8e61ebb75e8c1063e89518e3154a4b80381ed800.tar.bz2
Merge topic 'clang_cxx20'
b365385d66 Clang: Record Clang 6.0+ as fully supporting C++17 5d26efe38f Clang: Add final C++20 flag for Clang 11.0+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4887
-rw-r--r--Modules/Compiler/Clang.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index cd47aa6..bb516d3 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -146,7 +146,14 @@ macro(__compiler_clang_cxx_standards lang)
set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()
- if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
+ if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 6.0)
+ set(CMAKE_${lang}17_STANDARD__HAS_FULL_SUPPORT ON)
+ endif()
+
+ if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 11.0)
+ set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++20")
+ set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
+ elseif(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
endif()