diff options
author | Brad King <brad.king@kitware.com> | 2015-07-08 13:25:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-09 13:11:57 (GMT) |
commit | 228643af6d8c0e29735c3fdf7b25c161a11a68c9 (patch) | |
tree | 567e96f9349b63d6aaf9bcf26e502b67a70dbc03 /Modules/Compiler | |
parent | c66d232c9c138dcf54f5314aafb7ab32590b106d (diff) | |
download | CMake-228643af6d8c0e29735c3fdf7b25c161a11a68c9.zip CMake-228643af6d8c0e29735c3fdf7b25c161a11a68c9.tar.gz CMake-228643af6d8c0e29735c3fdf7b25c161a11a68c9.tar.bz2 |
AppleClang: Use modern C++14 standard flags for Apple Clang 6.1
The Apple Clang 6.1 compiler that comes with Xcode 6.3 is aware of the
modern -std=c++14 and -std=gnu++14 flags, so use them instead of the
"1y" flags.
Suggested-by: darkapostle@rule506.net
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/AppleClang-CXX.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 5194da4..1ba8a77 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -13,7 +13,10 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1) + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14") + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14") +elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) # AppleClang 5.0 knows this flag, but does not set a __cplusplus macro greater than 201103L set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y") set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y") |