diff options
author | Brad King <brad.king@kitware.com> | 2021-06-02 11:32:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-02 11:32:30 (GMT) |
commit | b25225bb618696370a99d8e92f9c67bd25c684aa (patch) | |
tree | eba9421cade7757818fbffa2af03dbac76de2919 /Modules/Compiler | |
parent | 2104cfe388f5d77b98727c89edff453b1d23fed6 (diff) | |
parent | 886e27062b130ed3ba1d70971f8d33570e821c33 (diff) | |
download | CMake-b25225bb618696370a99d8e92f9c67bd25c684aa.zip CMake-b25225bb618696370a99d8e92f9c67bd25c684aa.tar.gz CMake-b25225bb618696370a99d8e92f9c67bd25c684aa.tar.bz2 |
Merge topic 'msvc_cxx20_23'
886e27062b Clang/MSVC: C++20 final flag, C++23 support
3aaf1d91bf MSVC: C++20 final flag, C++23 support
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6174
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Clang.cmake | 15 | ||||
-rw-r--r-- | Modules/Compiler/MSVC-CXX.cmake | 9 |
2 files changed, 20 insertions, 4 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 9f93d41..7035d93 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -194,16 +194,25 @@ macro(__compiler_clang_cxx_standards lang) set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "") set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std:c++14") set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std:c++14") - if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) + + if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std:c++17") set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std:c++17") - set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std:c++latest") - set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std:c++latest") else() set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std:c++latest") set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std:c++latest") endif() + if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) + set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std:c++latest") + set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std:c++latest") + set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std:c++20") + set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std:c++20") + elseif(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) + set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std:c++latest") + set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std:c++latest") + endif() + __compiler_check_default_language_standard(${lang} 3.9 14) else() # This version of clang-cl, or the MSVC version it simulates, does not have diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 1dfc760..f1c7450 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -18,6 +18,7 @@ if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "") set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std:c++14") set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std:c++14") + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.11.25505) set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON) set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON) @@ -27,7 +28,13 @@ if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++latest") set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++latest") endif() - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.12.25835) + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30129) + set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++20") + set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++20") + set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std:c++latest") + set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std:c++latest") + elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.12.25835) set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest") set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++latest") endif() |