From 2c7acd34e2c3d7c314de278469349d5587910173 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 24 Jul 2023 15:12:16 -0400 Subject: cmComputeLinkInformation: add `OBJECT` libraries as link items This completes the transition started in commit b665966933 (cmComputeLinkInformation: track OBJECT library dependencies, 2023-07-22). --- Source/cmCommonTargetGenerator.cxx | 8 +------- Source/cmComputeLinkInformation.cxx | 13 +------------ Source/cmComputeLinkInformation.h | 3 --- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index e583daa..2d6ce98 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -173,13 +173,7 @@ std::vector cmCommonTargetGenerator::GetLinkedTargetDirectories( this->GeneratorTarget->GetLinkInformation(config)) { std::vector targets; for (auto const& item : cli->GetItems()) { - targets.push_back(item.Target); - } - for (auto const* target : cli->GetObjectLibrariesLinked()) { - targets.push_back(target); - } - - for (auto const* linkee : targets) { + auto const* linkee = item.Target; if (linkee && !linkee->IsImported() // Skip targets that build after this one in a static lib cycle. diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index be73fa3..ccd20a0 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -536,12 +536,6 @@ cmComputeLinkInformation::GetSharedLibrariesLinked() const return this->SharedLibrariesLinked; } -const std::vector& -cmComputeLinkInformation::GetObjectLibrariesLinked() const -{ - return this->ObjectLibrariesLinked; -} - bool cmComputeLinkInformation::Compute() { // Skip targets that do not link. @@ -1164,12 +1158,7 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry) this->AddItem(BT(libName, item.Backtrace)); } } else if (tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) { - if (!tgt->HaveCxx20ModuleSources() && !tgt->HaveFortranSources(config)) { - // Ignore object library! - // Its object-files should already have been extracted for linking. - } else { - this->ObjectLibrariesLinked.push_back(entry.Target); - } + this->Items.emplace_back(entry.Item, ItemIsPath::No, entry.Target); } else if (this->GlobalGenerator->IsXcode() && !tgt->GetImportedXcFrameworkPath(config).empty()) { this->Items.emplace_back( diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index e75423f..a988307 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -97,8 +97,6 @@ public: std::string GetRPathString(bool for_install) const; std::string GetChrpathString() const; std::set const& GetSharedLibrariesLinked() const; - std::vector const& GetObjectLibrariesLinked() - const; std::vector const& GetRuntimeDLLs() const { return this->RuntimeDLLs; @@ -136,7 +134,6 @@ private: std::vector XcFrameworkHeaderPaths; std::vector RuntimeSearchPath; std::set SharedLibrariesLinked; - std::vector ObjectLibrariesLinked; std::vector RuntimeDLLs; // Context information. -- cgit v0.12