[Cmake-commits] CMake branch, next, updated. v3.1.0-1668-g2a5d1c4

Stephen Kelly steveire at gmail.com
Sun Jan 11 10:53:31 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  2a5d1c4b018df139dec3a99a4fc67ac0a70111a7 (commit)
       via  3ad893b5c23566184bc78eafb1446c05bd39a643 (commit)
       via  98965fb12d0d07deb6d953624529f8b8151dce13 (commit)
      from  b71ecfb867f90c0f29f3ad9e0636b51726419bde (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a5d1c4b018df139dec3a99a4fc67ac0a70111a7
commit 2a5d1c4b018df139dec3a99a4fc67ac0a70111a7
Merge: b71ecfb 3ad893b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 11 10:53:31 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jan 11 10:53:31 2015 -0500

    Merge topic 'Xcode-clang-compile-features' into next
    
    3ad893b5 Features: Record for historical Xcode clang versions.
    98965fb1 Features: Record dialect flags for AppleClang 4.0+.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ad893b5c23566184bc78eafb1446c05bd39a643
commit 3ad893b5c23566184bc78eafb1446c05bd39a643
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 9 20:18:26 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:52:27 2015 +0100

    Features: Record for historical Xcode clang versions.

diff --git a/Modules/Compiler/AppleClang-C-FeatureTests.cmake b/Modules/Compiler/AppleClang-C-FeatureTests.cmake
index ec1d43f..6f3d6a7 100644
--- a/Modules/Compiler/AppleClang-C-FeatureTests.cmake
+++ b/Modules/Compiler/AppleClang-C-FeatureTests.cmake
@@ -1,5 +1,5 @@
 
-set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 501")
+set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 400")
 
 set(AppleClang_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
 set(_cmake_feature_test_c_static_assert "${AppleClang_C11}")
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index b7c1aca..0665745 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -19,7 +19,7 @@ macro(cmake_record_c_compile_features)
     record_compiler_features(C "${std_version}" ${list})
   endmacro()
 
-  if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
+  if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
     _get_appleclang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES)
     if (_result EQUAL 0)
       _get_appleclang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES)
diff --git a/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake
index 78bdb72..f67082c 100644
--- a/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake
@@ -3,7 +3,28 @@
 # Generic reference: http://clang.llvm.org/cxx_status.html
 # http://clang.llvm.org/docs/LanguageExtensions.html
 
-set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 501")
+# Note: CXX compiler in Xcode 4.3 does not set __apple_build_version__ and so is
+# not recognized as AppleClang.
+# Xcode_43 - Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
+# Xcode_44 - Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
+# Xcode_45 - Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
+# Xcode_46 - Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
+# Xcode_50 - Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
+# Xcode_51 - Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
+# Xcode_60 - Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
+# Xcode_61 - Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
+
+# There is some non-correspondance. __has_feature(cxx_user_literals) is
+# false for AppleClang 4.0 and 4.1, although it is reported as
+# supported in the reference link for Clang 3.1.  The compiler does not pass
+# the CompileFeatures/cxx_user_literals.cpp test.
+# cxx_attributes is listed as not supported until Clang 3.3. It works without
+# warning with AppleClang 5.0, but issues a gcc-compat warning for
+# AppleClang 4.0-4.2.
+# cxx_alignof and cxx_alignas tests work for early AppleClang versions, though
+# they are listed as supported for Clang 3.3 and later.
+
+set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 400")
 
 include("${CMAKE_CURRENT_LIST_DIR}/Clang-CXX-TestableFeatures.cmake")
 
@@ -16,16 +37,16 @@ set(_cmake_feature_test_cxx_digit_separators "${AppleClang51_CXX14}")
 # http://llvm.org/bugs/show_bug.cgi?id=19674
 set(_cmake_feature_test_cxx_generic_lambdas "${AppleClang51_CXX14}")
 
-set(AppleClang51_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L")
-set(_cmake_feature_test_cxx_enum_forward_declarations "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_sizeof_member "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_extended_friend_declarations "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_extern_templates "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_func_identifier "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_inline_namespaces "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_long_long_type "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_right_angle_brackets "${AppleClang51_CXX11}")
-set(_cmake_feature_test_cxx_variadic_macros "${AppleClang51_CXX11}")
+set(AppleClang40_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_enum_forward_declarations "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_sizeof_member "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_extended_friend_declarations "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_extern_templates "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_func_identifier "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_inline_namespaces "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_long_long_type "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_right_angle_brackets "${AppleClang40_CXX11}")
+set(_cmake_feature_test_cxx_variadic_macros "${AppleClang40_CXX11}")
 
 set(AppleClang_CXX98 "${_cmake_oldestSupported} && __cplusplus >= 199711L")
 set(_cmake_feature_test_cxx_template_template_parameters "${AppleClang_CXX98}")
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index e56f55b..a508623 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -26,8 +26,11 @@ macro(cmake_record_cxx_compile_features)
     record_compiler_features(CXX "${std_version}" ${list})
   endmacro()
 
-  if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
-    _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES)
+  if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
+    set(_result 0)
+    if(CMAKE_CXX14_STANDARD_COMPILE_OPTION)
+      _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES)
+    endif()
     if (_result EQUAL 0)
       _get_appleclang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
     endif()
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index b164f06..4308508 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -31,6 +31,26 @@ foreach(feature ${cxx_features})
   run_test(${feature} CXX)
 endforeach()
 
+if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
+    AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
+  # AppleClang prior to 5.1 does not set any preprocessor define to distinguish
+  # c++1y from c++11, so CMake does not support c++1y features before AppleClang 5.1.
+  list(REMOVE_ITEM CXX_non_features
+    cxx_attribute_deprecated
+    cxx_binary_literals
+  )
+endif()
+
+if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
+    AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2)
+  # AppleClang prior to 4.1 reports false for __has_feature(cxx_local_type_template_args)
+  # and __has_feature(cxx_unrestricted_unions) but it happens to pass these tests.
+  list(REMOVE_ITEM CXX_non_features
+    cxx_local_type_template_args
+    cxx_unrestricted_unions
+  )
+endif()
+
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
     AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
   # The cxx_alignof feature happens to work (for *this* testcase) with

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98965fb12d0d07deb6d953624529f8b8151dce13
commit 98965fb12d0d07deb6d953624529f8b8151dce13
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 11 16:38:10 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 11 16:52:05 2015 +0100

    Features: Record dialect flags for AppleClang 4.0+.

diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 10edc74..b7c1aca 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -1,7 +1,7 @@
 include(Compiler/Clang)
 __compiler_clang(C)
 
-if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
   set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
   set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
 
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index eb97f88..e56f55b 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -5,13 +5,16 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
   set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 endif()
 
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
+if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
   set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
   set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
 
   set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
   set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+endif()
 
+if(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")
 endif()

-----------------------------------------------------------------------

Summary of changes:
 Modules/Compiler/AppleClang-C-FeatureTests.cmake   |    2 +-
 Modules/Compiler/AppleClang-C.cmake                |    4 +-
 Modules/Compiler/AppleClang-CXX-FeatureTests.cmake |   43 +++++++++++++++-----
 Modules/Compiler/AppleClang-CXX.cmake              |   12 ++++--
 Tests/CompileFeatures/CMakeLists.txt               |   20 +++++++++
 5 files changed, 64 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list