summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang-CXX.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-05-06 09:59:12 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-05-20 14:03:48 (GMT)
commitcda233194f9caab8867b2451f3d859080a233d45 (patch)
tree1d85f65b5a8ae0f4a79baa5bdac5fdd1888aad4f /Modules/Compiler/Clang-CXX.cmake
parent2d5e3d2d2bfd79311c40db173d13f6d0cfb10019 (diff)
downloadCMake-cda233194f9caab8867b2451f3d859080a233d45.zip
CMake-cda233194f9caab8867b2451f3d859080a233d45.tar.gz
CMake-cda233194f9caab8867b2451f3d859080a233d45.tar.bz2
Features: Record for Clang 3.4
Clang 3.4 supports all features currently known to CMake.
Diffstat (limited to 'Modules/Compiler/Clang-CXX.cmake')
-rw-r--r--Modules/Compiler/Clang-CXX.cmake27
1 files changed, 26 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 0409c24..bdb6d69 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -6,7 +6,7 @@ if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
endif()
cmake_policy(GET CMP0025 appleClangPolicy)
-if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
+if(WIN32 OR (APPLE AND NOT appleClangPolicy STREQUAL NEW))
return()
endif()
@@ -22,3 +22,28 @@ 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()
+
+if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++1y")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
+endif()
+
+set(CMAKE_CXX_STANDARD_DEFAULT 98)
+
+macro(cmake_record_cxx_compile_features)
+ macro(_get_clang_features std_version list)
+ record_compiler_features(CXX "-std=${std_version}" ${list})
+ endmacro()
+
+ if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+ _get_clang_features(c++1y CMAKE_CXX14_COMPILE_FEATURES)
+ if (_result EQUAL 0)
+ _get_clang_features(c++11 CMAKE_CXX11_COMPILE_FEATURES)
+ endif()
+ if (_result EQUAL 0)
+ _get_clang_features(c++98 CMAKE_CXX98_COMPILE_FEATURES)
+ endif()
+ else()
+ set(_result 0)
+ endif()
+endmacro()