summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r--Source/cmComputeLinkDepends.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 802cfcf..9a075bd 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -358,7 +358,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
this->AddLinkEntries(depender_index, iface->Libraries);
// Handle dependent shared libraries.
- this->QueueSharedDependencies(depender_index, iface->SharedDeps);
+ this->FollowSharedDeps(depender_index, iface);
// Support for CMP0003.
for(std::vector<std::string>::const_iterator
@@ -379,6 +379,23 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
//----------------------------------------------------------------------------
void
cmComputeLinkDepends
+::FollowSharedDeps(int depender_index, cmTarget::LinkInterface const* iface,
+ bool follow_interface)
+{
+ // Follow dependencies if we have not followed them already.
+ if(this->SharedDepFollowed.insert(depender_index).second)
+ {
+ if(follow_interface)
+ {
+ this->QueueSharedDependencies(depender_index, iface->Libraries);
+ }
+ this->QueueSharedDependencies(depender_index, iface->SharedDeps);
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+cmComputeLinkDepends
::QueueSharedDependencies(int depender_index,
std::vector<std::string> const& deps)
{
@@ -430,8 +447,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
entry.Target->GetLinkInterface(this->Config))
{
// Follow public and private dependencies transitively.
- this->QueueSharedDependencies(index, iface->Libraries);
- this->QueueSharedDependencies(index, iface->SharedDeps);
+ this->FollowSharedDeps(index, iface, true);
}
}
}