diff options
author | Brad King <brad.king@kitware.com> | 2018-09-06 18:21:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-07 13:23:43 (GMT) |
commit | bea390e9bd68e1aa7d86b6aef7384f502c39068c (patch) | |
tree | b19be7471586c47e8a5b1a72f433a773a62ccee8 /Source/cmGeneratorTarget.cxx | |
parent | fc7e4d1ed85370d03acbd62bc753cced3550752b (diff) | |
download | CMake-bea390e9bd68e1aa7d86b6aef7384f502c39068c.zip CMake-bea390e9bd68e1aa7d86b6aef7384f502c39068c.tar.gz CMake-bea390e9bd68e1aa7d86b6aef7384f502c39068c.tar.bz2 |
Fix dependency propagation through same-name imported targets
If two imported targets in different directories have the same name we
should still be able to propagate transitive link dependencies from
both. Fix the target and link dependency analyzers to de-duplicate
targets using target pointers rather than target names since the
pointers will not be duplicated even if the names are.
Issue: #18345
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 377c008..080ff1c 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -4575,14 +4575,14 @@ void cmGeneratorTarget::ComputeLinkInterface( this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { // Shared libraries may have runtime implementation dependencies // on other shared libraries that are not in the interface. - std::unordered_set<std::string> emitted; + std::set<cmLinkItem> emitted; for (cmLinkItem const& lib : iface.Libraries) { - emitted.insert(lib.AsStr()); + emitted.insert(lib); } if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) { cmLinkImplementation const* impl = this->GetLinkImplementation(config); for (cmLinkImplItem const& lib : impl->Libraries) { - if (emitted.insert(lib.AsStr()).second) { + if (emitted.insert(lib).second) { if (lib.Target) { // This is a runtime dependency on another shared library. if (lib.Target->GetType() == cmStateEnums::SHARED_LIBRARY) { |