[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-3076-g380a053

Stephen Kelly steveire at gmail.com
Fri May 9 08:39:58 EDT 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  380a053aae3136483fee1491a3f5d9fc74904823 (commit)
       via  f5bf9d431166250257d4ff2716f74668b1fce16b (commit)
       via  3547a00d77a5a894a2d9133ac61a6c9ed3dda5e2 (commit)
      from  186e765d1cda1914e942e72b3282fe791fbfe1e4 (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=380a053aae3136483fee1491a3f5d9fc74904823
commit 380a053aae3136483fee1491a3f5d9fc74904823
Merge: 186e765 f5bf9d4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 9 08:39:57 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri May 9 08:39:57 2014 -0400

    Merge topic 'minor-cleanups' into next
    
    f5bf9d43 Tests: Make CompileFeature tests use highest standard known.
    3547a00d CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f5bf9d431166250257d4ff2716f74668b1fce16b
commit f5bf9d431166250257d4ff2716f74668b1fce16b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 21 16:59:40 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 9 14:39:30 2014 +0200

    Tests: Make CompileFeature tests use highest standard known.
    
    Remove the use of check_cxx_source_compiles which is now just getting in
    the way.
    
    Blacklist the cxx_alignof feature in the test with GNU 4.7. The test
    file compiles, but it is documented as available first in GNU 4.8.

diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 5edb69e..0694927 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -8,6 +8,8 @@ set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${GNU481_CXX11}")
 set(_cmake_feature_test_cxx_reference_qualified_functions "${GNU481_CXX11}")
 set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L")
 set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}")
+# The alignof feature works with GNU 4.7 and -std=c++11, but it is documented
+# as available with GNU 4.8, so treat that as true.
 set(_cmake_feature_test_cxx_alignof "${GNU48_CXX11}")
 set(_cmake_feature_test_cxx_attributes "${GNU48_CXX11}")
 set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 274c5ba..925f757 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -27,13 +27,29 @@ foreach(feature ${cxx_features})
   run_test(${feature} CXX)
 endforeach()
 
+if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
+    AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
+  list(REMOVE_ITEM CXX_non_features
+    cxx_alignof
+  )
+endif()
+
 if (CMAKE_CXX_COMPILE_FEATURES)
-  include(CheckCXXSourceCompiles)
   foreach(feature ${CXX_non_features})
-    check_cxx_source_compiles("#include \"${CMAKE_CURRENT_SOURCE_DIR}/${feature}.cpp\"\nint main() { return 0; }\n" ${feature}_works)
+    message("Testing feature : ${feature}")
+    try_compile(${feature}_works
+      "${CMAKE_CURRENT_BINARY_DIR}/${feature}_test"
+      "${CMAKE_CURRENT_SOURCE_DIR}/feature_test.cpp"
+      COMPILE_DEFINITIONS "-DTEST=${CMAKE_CURRENT_SOURCE_DIR}/${feature}.cpp"
+      CMAKE_FLAGS "-DCMAKE_CXX_STANDARD=11"
+      OUTPUT_VARIABLE OUTPUT
+    )
     if (${feature}_works)
       message(SEND_ERROR
-        "Feature ${feature} expected not to work for ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}.  Update the supported features or blacklist it.")
+        "Feature ${feature} expected not to work for ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}.
+Update the supported features or blacklist it.\n${OUTPUT}")
+    else()
+      message("Testing feature : ${feature} -- Fails, as expected.")
     endif()
   endforeach()
 endif()
diff --git a/Tests/CompileFeatures/feature_test.cpp b/Tests/CompileFeatures/feature_test.cpp
new file mode 100644
index 0000000..4406c16
--- /dev/null
+++ b/Tests/CompileFeatures/feature_test.cpp
@@ -0,0 +1,10 @@
+
+#define STRINGIFY_IMPL(X) #X
+#define STRINGIFY(X) STRINGIFY_IMPL(X)
+
+#include STRINGIFY(TEST)
+
+int main()
+{
+  return 0;
+}

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

Summary of changes:
 Modules/Compiler/GNU-CXX-FeatureTests.cmake |    2 ++
 Source/CMakeVersion.cmake                   |    2 +-
 Tests/CompileFeatures/CMakeLists.txt        |   22 +++++++++++++++++++---
 Tests/CompileFeatures/feature_test.cpp      |   10 ++++++++++
 4 files changed, 32 insertions(+), 4 deletions(-)
 create mode 100644 Tests/CompileFeatures/feature_test.cpp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list