[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-2358-g6e203ae

Stephen Kelly steveire at gmail.com
Tue Apr 15 12:38:46 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  6e203ae9bbd3005a964f824d20df32ef441da207 (commit)
       via  b8dd2f44d44fcdbbbcff19a440314ceca9d952e2 (commit)
       via  44957b4b0b4d9e142e18473d1f70f1aebf15b86e (commit)
      from  f5e1be0183045352773822a34f9ea6a56a22550f (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=6e203ae9bbd3005a964f824d20df32ef441da207
commit 6e203ae9bbd3005a964f824d20df32ef441da207
Merge: f5e1be0 b8dd2f4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Apr 15 12:38:45 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 15 12:38:45 2014 -0400

    Merge topic 'feature-absence-hard-error' into next
    
    b8dd2f44 Tests: Change target_compile_features test execution logic.
    44957b4b Features: FATAL_ERROR on compilers with no recorded features.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8dd2f44d44fcdbbbcff19a440314ceca9d952e2
commit b8dd2f44d44fcdbbbcff19a440314ceca9d952e2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Apr 15 18:33:52 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Apr 15 18:36:04 2014 +0200

    Tests: Change target_compile_features test execution logic.
    
    Run the tests if there are known features for the compiler - force the
    tests to be kept up-to-date with the compilers for which any features
    are recorded.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 12bd3b2..53fa427 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -197,8 +197,7 @@ if(BUILD_TESTING)
   ADD_TEST_MACRO(TarTest TarTest)
   ADD_TEST_MACRO(SystemInformation SystemInformation)
   ADD_TEST_MACRO(MathTest MathTest)
-  if(CMAKE_CXX_COMPILER_ID STREQUAL GNU
-      AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
+  if(CMAKE_CXX_COMPILE_FEATURES)
     ADD_TEST_MACRO(CompileFeatures CompileFeatures)
     ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features)
   endif()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index bdc6279..b468c2e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -129,7 +129,7 @@ add_RunCMake_test(File_Generate)
 add_RunCMake_test(ExportWithoutLanguage)
 add_RunCMake_test(target_link_libraries)
 
-if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
+if (CMAKE_CXX_COMPILE_FEATURES)
   add_RunCMake_test(target_compile_features)
 endif()
 add_RunCMake_test(CheckModules)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44957b4b0b4d9e142e18473d1f70f1aebf15b86e
commit 44957b4b0b4d9e142e18473d1f70f1aebf15b86e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Apr 15 18:09:21 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Apr 15 18:33:48 2014 +0200

    Features: FATAL_ERROR on compilers with no recorded features.
    
    Users of the new target_compile_features command are expected to
    check the existence of the CMAKE_CXX_COMPILE_FEATURES variable before
    attempting to use it to require features.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6ec40fb..07cfe12 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4604,8 +4604,28 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
 
   if (!featuresKnown || !*featuresKnown)
     {
-    // We know of no features for the compiler at all.
-    return true;
+    cmOStringStream e;
+    if (error)
+      {
+      e << "no";
+      }
+    else
+      {
+      e << "No";
+      }
+    e << " known features for compiler\n\""
+      << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID")
+      << "\"\nversion "
+      << this->GetDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << ".";
+    if (error)
+      {
+      *error = e.str();
+      }
+    else
+      {
+      this->IssueMessage(cmake::FATAL_ERROR, e.str());
+      }
+    return false;
     }
 
   std::vector<std::string> availableFeatures;
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 00e6702..bdc6279 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -53,6 +53,9 @@ add_RunCMake_test(ObjectLibrary)
 add_RunCMake_test(TargetObjects)
 add_RunCMake_test(TargetSources)
 add_RunCMake_test(find_dependency)
+if (NOT CMAKE_CXX_COMPILE_FEATURES)
+  set(CompileFeatures_ARGS -DRUN_NOSUPPORTEDCXXFEATURES_TEST=1)
+endif()
 add_RunCMake_test(CompileFeatures)
 if(NOT WIN32)
   add_RunCMake_test(PositionIndependentCode)
diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-result.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-stderr.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-stderr.txt
new file mode 100644
index 0000000..8b029ac
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at NoSupportedCxxFeatures.cmake:3 \(target_compile_features\):
+  target_compile_features no known features for compiler
+
+  "[^"]*"
+
+  version *[.0-9]+\.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures.cmake b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures.cmake
new file mode 100644
index 0000000..5121948
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures.cmake
@@ -0,0 +1,3 @@
+
+add_library(no_features empty.cpp)
+target_compile_features(no_features PRIVATE cxx_constexpr)
diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
index a6aeeee..adea989 100644
--- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
@@ -7,3 +7,8 @@ run_cmake(NotAFeature_OriginDebug)
 run_cmake(NotAFeature_OriginDebugGenex)
 run_cmake(NotAFeature_OriginDebugTransitive)
 run_cmake(NotAFeature_OriginDebug_target_compile_features)
+
+if (RUN_NOSUPPORTEDCXXFEATURES_TEST)
+  run_cmake(NoSupportedCxxFeatures)
+  run_cmake(NoSupportedCxxFeaturesGenex)
+endif()

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

Summary of changes:
 Source/cmMakefile.cxx                              |   24 ++++++++++++++++++--
 Tests/CMakeLists.txt                               |    3 +--
 Tests/RunCMake/CMakeLists.txt                      |    5 +++-
 .../NoSupportedCxxFeatures-result.txt}             |    0
 .../NoSupportedCxxFeatures-stderr.txt              |    8 +++++++
 .../CompileFeatures/NoSupportedCxxFeatures.cmake   |    3 +++
 Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake  |    5 ++++
 7 files changed, 43 insertions(+), 5 deletions(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CompileFeatures/NoSupportedCxxFeatures-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures-stderr.txt
 create mode 100644 Tests/RunCMake/CompileFeatures/NoSupportedCxxFeatures.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list