[Cmake-commits] CMake branch, next, updated. v2.8.12-4199-g0c02d83

Stephen Kelly steveire at gmail.com
Sun Oct 20 14:40:58 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  0c02d8327cf6be5dd364f43790d6d2044e84c3c0 (commit)
       via  3eeb83d1470309fab44bea65c669ba27b1818796 (commit)
      from  3d63217d93e1f9aee8084836415faad9aaa6f88d (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=0c02d8327cf6be5dd364f43790d6d2044e84c3c0
commit 0c02d8327cf6be5dd364f43790d6d2044e84c3c0
Merge: 3d63217 3eeb83d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 20 14:40:57 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Oct 20 14:40:57 2013 -0400

    Merge topic 'fix-tll-static-private' into next
    
    3eeb83d Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3eeb83d1470309fab44bea65c669ba27b1818796
commit 3eeb83d1470309fab44bea65c669ba27b1818796
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 20 20:39:16 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Oct 20 20:39:16 2013 +0200

    Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.
    
    Only valid target names or generator expressions may appear in
    the target field of a LINK_ONLY expression.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b6182ab..24978d9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -985,15 +985,20 @@ void cmTarget::MergeLinkLibraries( cmMakefile& mf,
   i += this->PrevLinkedLibraries.size();
   for( ; i != libs.end(); ++i )
     {
+    const char *lib = i->first.c_str();
     // We call this so that the dependencies get written to the cache
-    this->AddLinkLibrary( mf, selfname, i->first.c_str(), i->second );
+    this->AddLinkLibrary( mf, selfname, lib, i->second );
 
     if (this->GetType() == cmTarget::STATIC_LIBRARY)
       {
-      this->AppendProperty("INTERFACE_LINK_LIBRARIES",
-            ("$<LINK_ONLY:" +
-            this->GetDebugGeneratorExpressions(i->first.c_str(), i->second) +
-            ">").c_str());
+      if (cmGeneratorExpression::IsValidTargetName(lib)
+          || cmGeneratorExpression::Find(lib) != std::string::npos)
+        {
+        this->AppendProperty("INTERFACE_LINK_LIBRARIES",
+              ("$<LINK_ONLY:" +
+              this->GetDebugGeneratorExpressions(lib, i->second)
+              + ">").c_str());
+        }
       }
     }
   this->PrevLinkedLibraries = libs;
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 0707c62..d3db514 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -395,10 +395,14 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
       {
       if (this->Target->GetType() == cmTarget::STATIC_LIBRARY)
         {
-        this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
+        if (cmGeneratorExpression::IsValidTargetName(lib)
+            || cmGeneratorExpression::Find(lib) != std::string::npos)
+          {
+          this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
                   ("$<LINK_ONLY:" +
                   this->Target->GetDebugGeneratorExpressions(lib, llt) +
                   ">").c_str());
+          }
         }
       // Not a 'public' or 'interface' library. Do not add to interface
       // property.
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
index 07d7c43..7a5c621 100644
--- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
@@ -21,7 +21,10 @@ add_library(staticlib1 STATIC staticlib1.cpp)
 generate_export_header(staticlib1)
 add_library(staticlib2 STATIC staticlib2.cpp)
 generate_export_header(staticlib2)
+add_library(staticlib3 STATIC staticlib3.cpp)
+generate_export_header(staticlib3)
 target_link_libraries(staticlib1 LINK_PUBLIC staticlib2)
+target_link_libraries(staticlib1 LINK_PRIVATE "-L${CMAKE_CURRENT_BINARY_DIR} -Wl,--start-group -lstaticlib3 -Wl,--end-group")
 
 add_executable(staticlib_exe staticlib_exe.cpp)
 target_link_libraries(staticlib_exe staticlib1)

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

Summary of changes:
 Source/cmTarget.cxx                                |   15 ++++++++++-----
 Source/cmTargetLinkLibrariesCommand.cxx            |    6 +++++-
 .../target_link_libraries/cmp0022/CMakeLists.txt   |    3 +++
 3 files changed, 18 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list