summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-24 19:12:16 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-08-01 14:06:02 (GMT)
commit2c7acd34e2c3d7c314de278469349d5587910173 (patch)
tree275ca46359ef23d081aee36692ff4c21f281cda1
parente166bbef7bd8fa59c427911d96f41cd8a305af75 (diff)
downloadCMake-2c7acd34e2c3d7c314de278469349d5587910173.zip
CMake-2c7acd34e2c3d7c314de278469349d5587910173.tar.gz
CMake-2c7acd34e2c3d7c314de278469349d5587910173.tar.bz2
cmComputeLinkInformation: add `OBJECT` libraries as link items
This completes the transition started in commit b665966933 (cmComputeLinkInformation: track OBJECT library dependencies, 2023-07-22).
-rw-r--r--Source/cmCommonTargetGenerator.cxx8
-rw-r--r--Source/cmComputeLinkInformation.cxx13
-rw-r--r--Source/cmComputeLinkInformation.h3
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<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories(
this->GeneratorTarget->GetLinkInformation(config)) {
std::vector<cmGeneratorTarget const*> 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<const cmGeneratorTarget*>&
-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<std::string>(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<cmGeneratorTarget const*> const& GetSharedLibrariesLinked() const;
- std::vector<cmGeneratorTarget const*> const& GetObjectLibrariesLinked()
- const;
std::vector<cmGeneratorTarget const*> const& GetRuntimeDLLs() const
{
return this->RuntimeDLLs;
@@ -136,7 +134,6 @@ private:
std::vector<std::string> XcFrameworkHeaderPaths;
std::vector<std::string> RuntimeSearchPath;
std::set<cmGeneratorTarget const*> SharedLibrariesLinked;
- std::vector<cmGeneratorTarget const*> ObjectLibrariesLinked;
std::vector<cmGeneratorTarget const*> RuntimeDLLs;
// Context information.