summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-11 13:19:02 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-05-11 13:19:12 (GMT)
commitca11096fd39b391b09f1fffab11545b1c58e52fa (patch)
treec4e4dabb928c0a292419fc156e10a18912e8a0ef /Modules/Compiler
parentfdab87312cab30a731b635b22756bf5c3dc942db (diff)
parent9fbbebe3d03f2576a8c5d6284c6f122b99e232a9 (diff)
downloadCMake-ca11096fd39b391b09f1fffab11545b1c58e52fa.zip
CMake-ca11096fd39b391b09f1fffab11545b1c58e52fa.tar.gz
CMake-ca11096fd39b391b09f1fffab11545b1c58e52fa.tar.bz2
Merge topic 'cpp23_gcc'
9fbbebe3d0 GNU: C++23 support c9a1e06a18 GNU: Final C++20 flags 05f8c8178d GNU: C++17 default version Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6108
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/GNU-CXX.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 758d3c7..b35f254 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -61,9 +61,14 @@ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.1)
+ set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
+ set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
+ set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++23")
+ set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++23")
+elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
endif()
-__compiler_check_default_language_standard(CXX 3.4 98 6.0 14)
+__compiler_check_default_language_standard(CXX 3.4 98 6.0 14 11.1 17)