summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-01-17 21:25:19 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-01-17 21:25:19 (GMT)
commit05fbfd494eb3fb343e316808d390b22d8b71c7a0 (patch)
tree4c494b01f31c6c580978821ae0b13cdaa5292120 /Source
parent4cfaa91ef0ca4a85a7c39e4a9ef07eb299d5a7bf (diff)
parent8e756d2b9bb84b182a8402e71fb62d7a28d0a9c6 (diff)
downloadCMake-05fbfd494eb3fb343e316808d390b22d8b71c7a0.zip
CMake-05fbfd494eb3fb343e316808d390b22d8b71c7a0.tar.gz
CMake-05fbfd494eb3fb343e316808d390b22d8b71c7a0.tar.bz2
Merge topic 'link-shared-depend-cycle-issue-12647'
8e756d2 Tolerate cycles in shared library link interfaces (#12647)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkDepends.cxx22
-rw-r--r--Source/cmComputeLinkDepends.h4
2 files changed, 23 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);
}
}
}
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index e196e00..80a0454 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -105,6 +105,10 @@ private:
int DependerIndex;
};
std::queue<SharedDepEntry> SharedDepQueue;
+ std::set<int> SharedDepFollowed;
+ void FollowSharedDeps(int depender_index,
+ cmTarget::LinkInterface const* iface,
+ bool follow_interface = false);
void QueueSharedDependencies(int depender_index,
std::vector<std::string> const& deps);
void HandleSharedDependency(SharedDepEntry const& dep);