diff options
author | Brad King <brad.king@kitware.com> | 2018-03-26 18:22:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-26 18:23:41 (GMT) |
commit | 1b328e09a33e61293635c7ddb9bcff986ae8d1e7 (patch) | |
tree | 458a991bd8b6e2cd7565125e54a83e97d53b7c59 | |
parent | 0bc3e5788a669f16383a586fee4684e9a08488dc (diff) | |
download | CMake-1b328e09a33e61293635c7ddb9bcff986ae8d1e7.zip CMake-1b328e09a33e61293635c7ddb9bcff986ae8d1e7.tar.gz CMake-1b328e09a33e61293635c7ddb9bcff986ae8d1e7.tar.bz2 |
Features: Use -std=c++17 for C++ 17 on Clang 5.0+
Clang 5.0 added support for the `-std=c++17` flag.
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index efc68b3..8a7d64a 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -32,7 +32,10 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y") endif() - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.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 3.5) set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++1z") set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z") endif() |