summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-01 14:37:37 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-01 14:37:37 (GMT)
commit69251f75492a9bd1e3122e8e7ae7888e9c700a57 (patch)
tree2093785c45d7fb4601b1821d250658727711663b /Source/cmComputeLinkDepends.cxx
parent78160cee6e38feb651478dbe859a491a807b9dbc (diff)
downloadCMake-69251f75492a9bd1e3122e8e7ae7888e9c700a57.zip
CMake-69251f75492a9bd1e3122e8e7ae7888e9c700a57.tar.gz
CMake-69251f75492a9bd1e3122e8e7ae7888e9c700a57.tar.bz2
Define 'multiplicity' for cyclic dependencies
We create target property "LINK_INTERFACE_MULTIPLICITY" and a per-config version "LINK_INTERFACE_MULTIPLICITY_<CONFIG>". It sets the number of times a linker should scan through a mutually dependent group of static libraries. The largest value of this property on any target in the group is used. This will help projects link even for extreme cases of cyclic inter-target dependencies.
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r--Source/cmComputeLinkDepends.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 50a63eb..b5cee42 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -900,7 +900,7 @@ cmComputeLinkDepends::MakePendingComponent(unsigned int component)
// advantage that the item directly linked by a target requiring
// this component will come first which minimizes the number of
// repeats needed.
- pc.Count = 2;
+ pc.Count = this->ComputeComponentCount(nl);
}
// Store the entries to be seen.
@@ -910,6 +910,27 @@ cmComputeLinkDepends::MakePendingComponent(unsigned int component)
}
//----------------------------------------------------------------------------
+int cmComputeLinkDepends::ComputeComponentCount(NodeList const& nl)
+{
+ int count = 2;
+ for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
+ {
+ if(cmTarget* target = this->EntryList[*ni].Target)
+ {
+ if(cmTarget::LinkInterface const* iface =
+ target->GetLinkInterface(this->Config))
+ {
+ if(iface->Multiplicity > count)
+ {
+ count = iface->Multiplicity;
+ }
+ }
+ }
+ }
+ return count;
+}
+
+//----------------------------------------------------------------------------
void cmComputeLinkDepends::DisplayFinalEntries()
{
fprintf(stderr, "target [%s] links to:\n", this->Target->GetName());