[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-2404-ga0f4f14

Stephen Kelly steveire at gmail.com
Wed Apr 16 11:27: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  a0f4f14a0dda529004b6d605eca780c5eb8d5d32 (commit)
       via  a69c13b0dc130773418e62c3867bc738c869770e (commit)
       via  8a07453869ee9aaeca3087a15bc1bc4fe7dba68c (commit)
       via  597bb72ed7a74bf9b70dec8726113050e731d667 (commit)
      from  c46d2494d660fe7f5248debb99993c4bc07412f3 (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=a0f4f14a0dda529004b6d605eca780c5eb8d5d32
commit a0f4f14a0dda529004b6d605eca780c5eb8d5d32
Merge: c46d249 a69c13b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 16 11:27:57 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 16 11:27:57 2014 -0400

    Merge topic 'feature-absence-hard-error' into next
    
    a69c13b0 Features: FATAL_ERROR on compilers with no recorded features.
    8a074538 Tests: Execute compile features tests unconditionally.
    597bb72e Tests: Run RunCMake.target_compile_features unconditionally.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a69c13b0dc130773418e62c3867bc738c869770e
commit a69c13b0dc130773418e62c3867bc738c869770e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Apr 15 18:09:21 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 16 17:26:28 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/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/NoSupportedCxxFeaturesGenex-result.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-stderr.txt b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-stderr.txt
new file mode 100644
index 0000000..d8366b2
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+  No known features for compiler
+
+  "[^"]*"
+
+  version *[.0-9]+\.
diff --git a/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex.cmake b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex.cmake
new file mode 100644
index 0000000..490f187
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/NoSupportedCxxFeaturesGenex.cmake
@@ -0,0 +1,3 @@
+
+add_library(no_features empty.cpp)
+target_compile_features(no_features PRIVATE $<1:cxx_constexpr>)
diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
index a6aeeee..43d4cb3 100644
--- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake
@@ -7,3 +7,14 @@ run_cmake(NotAFeature_OriginDebug)
 run_cmake(NotAFeature_OriginDebugGenex)
 run_cmake(NotAFeature_OriginDebugTransitive)
 run_cmake(NotAFeature_OriginDebug_target_compile_features)
+
+run_cmake(generate_feature_list)
+file(READ
+  "${RunCMake_BINARY_DIR}/generate_feature_list-build/features.txt"
+  FEATURES
+)
+
+if (NOT FEATURES)
+  run_cmake(NoSupportedCxxFeatures)
+  run_cmake(NoSupportedCxxFeaturesGenex)
+endif()
diff --git a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake
new file mode 100644
index 0000000..2bbbd17
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake
@@ -0,0 +1,4 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/features.txt"
+  "${CMAKE_CXX_COMPILE_FEATURES}"
+)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a07453869ee9aaeca3087a15bc1bc4fe7dba68c
commit 8a07453869ee9aaeca3087a15bc1bc4fe7dba68c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 16 17:22:01 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 16 17:25:33 2014 +0200

    Tests: Execute compile features tests unconditionally.
    
    Conditionally create a dummy test if there are no known features.

diff --git a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
index ad76411..f03f33d 100644
--- a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
@@ -1,6 +1,14 @@
 cmake_minimum_required(VERSION 3.0)
 project(target_compile_features)
 
+if (NOT CMAKE_CXX_COMPILE_FEATURES)
+  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp"
+    "int main(int,char**) { return 0; }\n"
+  )
+  add_executable(target_compile_features "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
+  return()
+endif()
+
 set(CMAKE_VERBOSE_MAKEFILE ON)
 
 add_executable(target_compile_features main.cpp)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 12bd3b2..9d642cc 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -197,11 +197,9 @@ 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)
-    ADD_TEST_MACRO(CompileFeatures CompileFeatures)
-    ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features)
-  endif()
+  ADD_TEST_MACRO(CompileFeatures CompileFeatures)
+  ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features)
+
   # assume no resources building to test
   set(TEST_RESOURCES FALSE)
   # for windows and cygwin assume we have resources
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index bceb6bb..ce5004b 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -3,6 +3,14 @@ cmake_minimum_required(VERSION 3.0)
 
 project(CompileFeatures)
 
+if (NOT CMAKE_CXX_COMPILE_FEATURES)
+  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp"
+    "int main(int,char**) { return 0; }\n"
+  )
+  add_executable(CompileFeatures "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
+  return()
+endif()
+
 macro(run_test feature)
   if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ${feature})
     add_library(test_${feature} OBJECT ${feature}.cpp)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=597bb72ed7a74bf9b70dec8726113050e731d667
commit 597bb72ed7a74bf9b70dec8726113050e731d667
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 16 17:20:15 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 16 17:22:19 2014 +0200

    Tests: Run RunCMake.target_compile_features unconditionally.
    
    It is so far testing only cases which are fatal regardless of
    recorded features.

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 00e6702..e797a73 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -126,9 +126,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)
-  add_RunCMake_test(target_compile_features)
-endif()
+add_RunCMake_test(target_compile_features)
 add_RunCMake_test(CheckModules)
 add_RunCMake_test(CommandLine)
 

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list