diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-10-12 23:26:16 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-07 14:48:44 (GMT) |
commit | 8238a6cd5d2867e709e87a752e0a24c7c2bf28f0 (patch) | |
tree | adfccd2f25ec52fee35d4fcfbf4a244e22cb2092 /Modules/Compiler/Clang-CXX.cmake | |
parent | 892243fc3bbc2bbd859cf6c6aaa7b1e1c19d59c9 (diff) | |
download | CMake-8238a6cd5d2867e709e87a752e0a24c7c2bf28f0.zip CMake-8238a6cd5d2867e709e87a752e0a24c7c2bf28f0.tar.gz CMake-8238a6cd5d2867e709e87a752e0a24c7c2bf28f0.tar.bz2 |
Add some COMPILE_OPTIONS for specifying C++ dialect.
These are compiler-specific, compiler version specific, extension specific
and standard version specific.
Diffstat (limited to 'Modules/Compiler/Clang-CXX.cmake')
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index ab1b766..a1b3a10 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -9,3 +9,16 @@ cmake_policy(GET CMP0025 appleClangPolicy) if(NOT appleClangPolicy STREQUAL NEW) return() endif() + +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1) + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") +endif() + +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1) + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") +elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1) + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") +endif() |