summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-06-13 08:13:55 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-06-13 08:29:51 (GMT)
commit5d26efe38f3ed5112788ac462b293809530acbce (patch)
tree3c920950b1bfe4a26f9eca57a5f78a6b7af1bea0
parent594fda9c234915669dbfe61bec7c59250e747b4a (diff)
downloadCMake-5d26efe38f3ed5112788ac462b293809530acbce.zip
CMake-5d26efe38f3ed5112788ac462b293809530acbce.tar.gz
CMake-5d26efe38f3ed5112788ac462b293809530acbce.tar.bz2
Clang: Add final C++20 flag for Clang 11.0+
-std=c++20 superseded -std=c++2a in upstream Clang commit 24ad121582454e625bdad125c90d9ac0dae948c8.
-rw-r--r--Modules/Compiler/Clang.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index cd47aa6..b84bdb2 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -146,7 +146,10 @@ 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 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()