[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3297-g90a50c1

Ben Boeckel ben.boeckel at kitware.com
Mon Jul 22 17:28:19 EDT 2013


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  90a50c1381cb8524fa60cc195833cb84e9e34095 (commit)
       via  654a840f5ef4171caf75a1f8b234c37acd730da9 (commit)
       via  8c808ab2ad95f70d1bc6da5e30ff8f23517ec80e (commit)
      from  3d87c935cda0b90bf3017dad3795ed428fa75fcb (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=90a50c1381cb8524fa60cc195833cb84e9e34095
commit 90a50c1381cb8524fa60cc195833cb84e9e34095
Merge: 3d87c93 654a840
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Jul 22 17:28:18 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 22 17:28:18 2013 -0400

    Merge topic 'dev/export-target-without-language' into next
    
    654a840 Error when exporting a target without a language
    8c808ab Test exporting a library without a target


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=654a840f5ef4171caf75a1f8b234c37acd730da9
commit 654a840f5ef4171caf75a1f8b234c37acd730da9
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Jul 22 17:25:46 2013 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Mon Jul 22 17:25:46 2013 -0400

    Error when exporting a target without a language
    
    First, it prevents a NULL dereference and second it reiterates that
    targets without languages are not supported by CMake.

diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 90e6d51..4de1aae 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -349,6 +349,16 @@ void getCompatibleInterfaceProperties(cmTarget *target,
 {
   cmComputeLinkInformation *info = target->GetLinkInformation(config);
 
+  if (!info)
+    {
+    cmMakefile* mf = target->GetMakefile();
+    cmOStringStream e;
+    e << "Exporting the target \"" << target->GetName() << "\" is not "
+         "allowed since its linker language cannot be determined";
+    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return;
+    }
+
   const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
 
   for(cmComputeLinkInformation::ItemVector::const_iterator li =

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c808ab2ad95f70d1bc6da5e30ff8f23517ec80e
commit 8c808ab2ad95f70d1bc6da5e30ff8f23517ec80e
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Jul 22 17:25:21 2013 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Mon Jul 22 17:25:21 2013 -0400

    Test exporting a library without a target

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index fcefaf9..dfd2226 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -240,10 +240,13 @@ if(BUILD_TESTING)
   ADD_TEST_MACRO(ExportImport ExportImport)
   ADD_TEST_MACRO(Unset Unset)
   ADD_TEST_MACRO(PolicyScope PolicyScope)
+  ADD_TEST_MACRO(ExportWithoutLanguage ExportWithoutLanguage)
   ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
   ADD_TEST_MACRO(CompileDefinitions CompileDefinitions)
   ADD_TEST_MACRO(CompileOptions CompileOptions)
   ADD_TEST_MACRO(CompatibleInterface CompatibleInterface)
+  set_tests_properties(ExportWithoutLanguage PROPERTIES
+    PASS_REGULAR_EXPRESSION "Exporting the target \"NoLanguage\" is not allowed since its linker language")
   set_tests_properties(EmptyLibrary PROPERTIES
     PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target: test")
   ADD_TEST_MACRO(CrossCompile CrossCompile)
diff --git a/Tests/ExportWithoutLanguage/CMakeLists.txt b/Tests/ExportWithoutLanguage/CMakeLists.txt
new file mode 100644
index 0000000..2ede854
--- /dev/null
+++ b/Tests/ExportWithoutLanguage/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(NoLanguage header.h)
+export(TARGETS NoLanguage FILE "${CMAKE_CURRENT_BINARY_DIR}/export.cmake")
diff --git a/Tests/ExportWithoutLanguage/header.h b/Tests/ExportWithoutLanguage/header.h
new file mode 100644
index 0000000..e69de29

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

Summary of changes:
 Source/cmExportFileGenerator.cxx                   |   10 ++++++++++
 Tests/CMakeLists.txt                               |    3 +++
 Tests/ExportWithoutLanguage/CMakeLists.txt         |    2 ++
 .../ExportWithoutLanguage/header.h                 |    0
 4 files changed, 15 insertions(+), 0 deletions(-)
 create mode 100644 Tests/ExportWithoutLanguage/CMakeLists.txt
 copy Modules/IntelVSImplicitPath/hello.f => Tests/ExportWithoutLanguage/header.h (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list