summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-26 18:21:41 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-26 18:23:41 (GMT)
commit0bc3e5788a669f16383a586fee4684e9a08488dc (patch)
treea66d16f6bd8f2d27f4ab9e7ec1bfef2165c35fbf /Modules
parent6792c7787aedc0fb2a32b6ca563917f7447f2e80 (diff)
downloadCMake-0bc3e5788a669f16383a586fee4684e9a08488dc.zip
CMake-0bc3e5788a669f16383a586fee4684e9a08488dc.tar.gz
CMake-0bc3e5788a669f16383a586fee4684e9a08488dc.tar.bz2
Features: Use -std=c++17 for C++ 17 on GNU 8.0+
GNU 8 now documents official support for the `-std=c++17` flag.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/GNU-CXX.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 4f1f30e..0b15d25 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -33,7 +33,10 @@ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
endif()
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
+if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()