[Cmake-commits] CMake branch, next, updated. v3.1.0-1328-gbf87bec

Brad King brad.king at kitware.com
Mon Dec 22 10:45:24 EST 2014


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  bf87becbc3d333ee1902226787aca69142789855 (commit)
       via  bd6b42c1864dc1915e5c86cceb609e87f72f93b6 (commit)
       via  b341799e53e468a02bca78e3270e60ddccf8b4f3 (commit)
      from  389409be3b5b11e8604429179d4998764268fa24 (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=bf87becbc3d333ee1902226787aca69142789855
commit bf87becbc3d333ee1902226787aca69142789855
Merge: 389409b bd6b42c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Dec 22 10:45:23 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Dec 22 10:45:23 2014 -0500

    Merge topic 'AppleClang-5.1-features' into next
    
    bd6b42c1 Features: Record for AppleClang 5.1
    b341799e Tests: Fix RunCMake.CompileFeatures test NonValidTarget2 case


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd6b42c1864dc1915e5c86cceb609e87f72f93b6
commit bd6b42c1864dc1915e5c86cceb609e87f72f93b6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Nov 12 22:48:17 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Dec 22 10:44:41 2014 -0500

    Features: Record for AppleClang 5.1
    
    Apple's Clang 5.1 already supports most of the C and C++ features CMake
    enumerates.

diff --git a/Modules/Compiler/AppleClang-C-FeatureTests.cmake b/Modules/Compiler/AppleClang-C-FeatureTests.cmake
new file mode 100644
index 0000000..ec1d43f
--- /dev/null
+++ b/Modules/Compiler/AppleClang-C-FeatureTests.cmake
@@ -0,0 +1,11 @@
+
+set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 501")
+
+set(AppleClang_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
+set(_cmake_feature_test_c_static_assert "${AppleClang_C11}")
+set(AppleClang_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
+set(_cmake_feature_test_c_restrict "${AppleClang_C99}")
+set(_cmake_feature_test_c_variadic_macros "${AppleClang_C99}")
+
+set(AppleClang_C90 "${_cmake_oldestSupported} && !defined(__STDC_VERSION__)")
+set(_cmake_feature_test_c_function_prototypes "${AppleClang_C90}")
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 98fcd0b..10edc74 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -1,2 +1,33 @@
 include(Compiler/Clang)
 __compiler_clang(C)
+
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
+  set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
+  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
+
+  set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
+  set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
+
+  set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
+  set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+endif()
+
+set(CMAKE_C_STANDARD_DEFAULT 99)
+
+macro(cmake_record_c_compile_features)
+  macro(_get_appleclang_features std_version list)
+    record_compiler_features(C "${std_version}" ${list})
+  endmacro()
+
+  if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
+    _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)
+    endif()
+    if (_result EQUAL 0)
+      _get_appleclang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES)
+    endif()
+  else()
+    set(_result 0)
+  endif()
+endmacro()
diff --git a/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake
new file mode 100644
index 0000000..78bdb72
--- /dev/null
+++ b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake
@@ -0,0 +1,31 @@
+
+# No known reference for AppleClang versions.
+# 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")
+
+include("${CMAKE_CURRENT_LIST_DIR}/Clang-CXX-TestableFeatures.cmake")
+
+set(AppleClang51_CXX14 "((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L")
+# http://llvm.org/bugs/show_bug.cgi?id=19242
+set(_cmake_feature_test_cxx_attribute_deprecated "${AppleClang51_CXX14}")
+# http://llvm.org/bugs/show_bug.cgi?id=19698
+set(_cmake_feature_test_cxx_decltype_auto "${AppleClang51_CXX14}")
+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(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 c1acae6..eb97f88 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -4,3 +4,34 @@ __compiler_clang(CXX)
 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)
+  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")
+
+  set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
+  set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
+endif()
+
+set(CMAKE_CXX_STANDARD_DEFAULT 98)
+
+macro(cmake_record_cxx_compile_features)
+  macro(_get_appleclang_features std_version list)
+    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 (_result EQUAL 0)
+      _get_appleclang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+    endif()
+    if (_result EQUAL 0)
+      _get_appleclang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES)
+    endif()
+  else()
+    set(_result 0)
+  endif()
+endmacro()
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 0b6f0de..36b9706 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -100,7 +100,7 @@
 #    write_compiler_detection_header(
 #      FILE climbingstats_compiler_detection.h
 #      PREFIX ClimbingStats
-#      COMPILERS GNU Clang
+#      COMPILERS GNU Clang AppleClang
 #      FEATURES cxx_variadic_templates
 #    )
 #
@@ -315,6 +315,7 @@ function(write_compiler_detection_header
   set(compilers
     GNU
     Clang
+    AppleClang
   )
 
   set(_hex_compilers ADSP Borland Embarcadero SunPro)
@@ -513,7 +514,7 @@ function(write_compiler_detection_header
         set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} alignas(X)
-#  elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang
+#  elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang
 #    define ${def_value} __attribute__ ((__aligned__(X)))
 #  else
 #    define ${def_value}
@@ -525,7 +526,7 @@ function(write_compiler_detection_header
         set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} alignof(X)
-#  elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang
+#  elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang
 #    define ${def_value} __alignof__(X)
 #  endif
 \n")
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 62c7e8c..5b2f1de 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -11,7 +11,7 @@ get_property(c_known_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES)
 write_compiler_detection_header(
   FILE "${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h"
   PREFIX TEST
-  COMPILERS GNU Clang
+  COMPILERS GNU Clang AppleClang
   VERSION 3.1
   PROLOG "// something"
   EPILOG "// more"
@@ -57,14 +57,16 @@ macro(set_defines target true_defs false_defs)
 endmacro()
 
 if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
-    OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+    OR CMAKE_CXX_COMPILER_ID STREQUAL Clang
+    OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
   # False for C++98 mode.
   list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS)
   list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
 endif()
 
 if (CMAKE_C_COMPILER_ID STREQUAL GNU
-    OR CMAKE_C_COMPILER_ID STREQUAL Clang)
+    OR CMAKE_C_COMPILER_ID STREQUAL Clang
+    OR CMAKE_C_COMPILER_ID STREQUAL AppleClang)
   add_executable(C_undefined c_undefined.c)
   set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90)
   target_compile_options(C_undefined PRIVATE -Werror=undef)
@@ -79,7 +81,7 @@ write_compiler_detection_header(
   PREFIX MULTI
   OUTPUT_FILES_VAR multi_files
   OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support"
-  COMPILERS GNU Clang
+  COMPILERS GNU Clang AppleClang
   VERSION 3.1
   FEATURES
     ${cxx_known_features} ${c_known_features}

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b341799e53e468a02bca78e3270e60ddccf8b4f3
commit b341799e53e468a02bca78e3270e60ddccf8b4f3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Dec 22 10:34:12 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Dec 22 10:36:35 2014 -0500

    Tests: Fix RunCMake.CompileFeatures test NonValidTarget2 case
    
    Mark the generated source file with the GENERATED property explicitly
    since it is not marked automatically as the output of any custom
    command.  Mark both the 0 and 1 variants so it works no matter the
    outcome of the generator expression.

diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake
index eb84692..c41bf57 100644
--- a/Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake
+++ b/Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake
@@ -4,5 +4,7 @@ set(genexvar $<COMPILE_FEATURES:cxx_final>)
 add_custom_target(copy_target
   COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.txt"
 )
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/copied_file0.cpp" PROPERTY GENERATED 1)
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/copied_file1.cpp" PROPERTY GENERATED 1)
 
 add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp")

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list