summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-10-17 12:26:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-10-17 12:26:52 (GMT)
commit67aef2b2c584514285f62a2bd1ac568eeb06e4ff (patch)
treebf18752e6ae6dd402b7523308cb71b47d7651e9b /Source
parentfb1a3270442a0f6250cda7f5a916c116e74742d7 (diff)
parent262c27719767a3f5262dd9327d5f8c8ecf013e0e (diff)
downloadCMake-67aef2b2c584514285f62a2bd1ac568eeb06e4ff.zip
CMake-67aef2b2c584514285f62a2bd1ac568eeb06e4ff.tar.gz
CMake-67aef2b2c584514285f62a2bd1ac568eeb06e4ff.tar.bz2
Merge topic 'revert-link-dedup-imported-targets' into release-3.31
262c277197 Revert "Ensure imported targets in sibling dirs are deduplicated" 645b57b8cd Tests/RunCMake/CMP0156: Match expected results more precisely Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9909
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkDepends.cxx35
1 files changed, 2 insertions, 33 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 5d92549..ab2557b 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -33,7 +33,6 @@
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
#include "cmake.h"
@@ -477,7 +476,6 @@ public:
this->Target->GetPolicyStatusCMP0179() == cmPolicies::NEW) {
// keep the first occurrence of the static libraries
std::set<size_t> emitted{ this->Emitted };
- std::set<std::string> importedEmitted;
for (auto index : libEntries) {
LinkEntry const& entry = this->Entries[index];
if (!entry.Target ||
@@ -485,20 +483,7 @@ public:
entries.emplace_back(index);
continue;
}
- if (this->IncludeEntry(entry)) {
- entries.emplace_back(index);
- continue;
- }
- if (entry.Target->IsImported()) {
- if (emitted.insert(index).second &&
- importedEmitted
- .insert(cmSystemTools::GetRealPath(entry.Item.Value))
- .second) {
- entries.emplace_back(index);
- }
- continue;
- }
- if (emitted.insert(index).second) {
+ if (this->IncludeEntry(entry) || emitted.insert(index).second) {
entries.emplace_back(index);
}
}
@@ -604,22 +589,7 @@ private:
{
for (auto index : libEntries) {
LinkEntry const& entry = this->Entries[index];
- if (this->IncludeEntry(entry)) {
- this->FinalEntries.emplace_back(entry);
- continue;
- }
- if (entry.Target && entry.Target->IsImported()) {
- // Different imported targets can point to the same library so check
- // also library paths
- if (this->Emitted.insert(index).second &&
- this->ImportedEmitted
- .insert(cmSystemTools::GetRealPath(entry.Item.Value))
- .second) {
- this->FinalEntries.emplace_back(entry);
- }
- continue;
- }
- if (this->Emitted.insert(index).second) {
+ if (this->IncludeEntry(entry) || this->Emitted.insert(index).second) {
this->FinalEntries.emplace_back(entry);
}
}
@@ -632,7 +602,6 @@ private:
EntryVector& Entries;
EntryVector& FinalEntries;
std::set<size_t> Emitted;
- std::set<std::string> ImportedEmitted;
const std::map<size_t, std::vector<size_t>>* Groups = nullptr;
};
}