[Cmake-commits] CMake branch, next, updated. v3.0.0-4641-g0f95e19

Brad King brad.king at kitware.com
Wed Jul 30 11:35:12 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  0f95e197ce91094440411992424ce2052d468dcc (commit)
       via  9f7e27fc3a2d2b1863147f235a2980de019ee7c9 (commit)
      from  2a78767e5e25fea144b70a4c611faaf160452da0 (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=0f95e197ce91094440411992424ce2052d468dcc
commit 0f95e197ce91094440411992424ce2052d468dcc
Merge: 2a78767 9f7e27f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 30 11:35:11 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 30 11:35:11 2014 -0400

    Merge topic 'link-line-dedup' into next
    
    9f7e27fc De-duplicate shared library targets in generated link lines


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f7e27fc3a2d2b1863147f235a2980de019ee7c9
commit 9f7e27fc3a2d2b1863147f235a2980de019ee7c9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 30 11:14:17 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jul 30 11:14:17 2014 -0400

    De-duplicate shared library targets in generated link lines
    
    The linker will bring in shared libraries as a whole and use them even
    for symbols that are needed by entries later in the link line.
    Therefore we do not need to repeat them.  De-duplicate link entries that
    we know are shared libraries because we have a cmTarget associated with
    them.
    
    Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>

diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index c13da50..b13a125 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -166,7 +166,8 @@ guaranteed to be acyclic.
 
 The final list of items produced by this procedure consists of the
 original user link line followed by minimal additional items needed to
-satisfy dependencies.
+satisfy dependencies.  The final list is then filtered to de-duplicate
+items that we know the linker will re-use automatically (shared libs).
 
 */
 
@@ -262,10 +263,20 @@ cmComputeLinkDepends::Compute()
   this->OrderLinkEntires();
 
   // Compute the final set of link entries.
+  std::set<int> emmitted;
   for(std::vector<int>::const_iterator li = this->FinalLinkOrder.begin();
       li != this->FinalLinkOrder.end(); ++li)
     {
-    this->FinalLinkEntries.push_back(this->EntryList[*li]);
+    int i = *li;
+    LinkEntry const& e = this->EntryList[i];
+    cmTarget const* t = e.Target;
+    // Entries that we know the linker will re-use for symbols
+    // needed by later entries do not need to be repeated.
+    bool uniquify = t && t->GetType() == cmTarget::SHARED_LIBRARY;
+    if(!uniquify || emmitted.insert(i).second)
+      {
+      this->FinalLinkEntries.push_back(e);
+      }
     }
 
   // Display the final set.

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

Summary of changes:
 Source/cmComputeLinkDepends.cxx |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list