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
This commit is contained in:
Brad King 2015-07-08 09:25:02 -04:00
parent c66d232c9c
commit 228643af6d
1 changed files with 4 additions and 1 deletions

View File

@ -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")