summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
diff options
context:
space:
mode:
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());