diff options
author | Raul Tambre <raul@tambre.ee> | 2021-05-08 10:45:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-10 14:19:13 (GMT) |
commit | c9a1e06a18594640d548b1aec31ea9e07b0b5b82 (patch) | |
tree | a4ba0c72d5cf2784b5d1547c6beb5536b5b45f5e /Modules/Compiler/GNU-CXX.cmake | |
parent | 05f8c8178dabe3ca8080af0f12ff578cd02971b8 (diff) | |
download | CMake-c9a1e06a18594640d548b1aec31ea9e07b0b5b82.zip CMake-c9a1e06a18594640d548b1aec31ea9e07b0b5b82.tar.gz CMake-c9a1e06a18594640d548b1aec31ea9e07b0b5b82.tar.bz2 |
GNU: Final C++20 flags
Added in GCC commit fb26050409473f5be54465beca114b7e48de43aa, released in 11.1.
Diffstat (limited to 'Modules/Compiler/GNU-CXX.cmake')
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index d7318ea..c8357b2 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -61,7 +61,10 @@ 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") +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() |