[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3372-g31ec803

Brad King brad.king at kitware.com
Thu Jul 25 08:46:16 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  31ec803b7b731607d04f2d7ff7ddd0a2fc96f0cd (commit)
       via  5837f19690c7ef490e70baedce0a8b89594da3af (commit)
      from  172ef5afdd5a549a59132c7243917469e31177ab (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=31ec803b7b731607d04f2d7ff7ddd0a2fc96f0cd
commit 31ec803b7b731607d04f2d7ff7ddd0a2fc96f0cd
Merge: 172ef5a 5837f19
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 25 08:45:57 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 25 08:45:57 2013 -0400

    Merge topic 'dev/export-target-without-language' into next
    
    5837f19 export: Error when exporting a target without a language


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5837f19690c7ef490e70baedce0a8b89594da3af
commit 5837f19690c7ef490e70baedce0a8b89594da3af
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Jul 22 17:25:21 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 25 08:44:57 2013 -0400

    export: 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.
    
    Add a RunCMake.ExportWithoutLanguage test exporting a library without a
    languages.

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 =
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 12f68d7..d561c34 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -115,4 +115,5 @@ if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
 endif()
 
 add_RunCMake_test(File_Generate)
+add_RunCMake_test(ExportWithoutLanguage)
 add_RunCMake_test(target_link_libraries)
diff --git a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt
new file mode 100644
index 0000000..67a0ae3
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error: CMake can not determine linker language for target: NoLanguage
+CMake Error at NoLanguage.cmake:2 \(export\):
+  Exporting the target "NoLanguage" is not allowed since its linker language
+  cannot be determined
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake
new file mode 100644
index 0000000..2ede854
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake
@@ -0,0 +1,2 @@
+add_library(NoLanguage header.h)
+export(TARGETS NoLanguage FILE "${CMAKE_CURRENT_BINARY_DIR}/export.cmake")
diff --git a/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake b/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake
new file mode 100644
index 0000000..f77f4eb
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(NoLanguage)

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list