diff options
author | Brad King <brad.king@kitware.com> | 2023-07-24 12:31:45 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-07-24 12:31:53 (GMT) |
commit | f8c3fd0c45f9b1358f301371f3b37327f54641d0 (patch) | |
tree | 0e9447b426bc944478c03c795977a392e16d10e8 /Source/cmComputeLinkInformation.cxx | |
parent | ee9908df397faf6b02e29a0516f931d913440101 (diff) | |
parent | b665966933c8656d1dafde06b8f29fe7e4901738 (diff) | |
download | CMake-f8c3fd0c45f9b1358f301371f3b37327f54641d0.zip CMake-f8c3fd0c45f9b1358f301371f3b37327f54641d0.tar.gz CMake-f8c3fd0c45f9b1358f301371f3b37327f54641d0.tar.bz2 |
Merge topic 'dyndep-module-info-objlib-dependency'
b665966933 cmComputeLinkInformation: track OBJECT library dependencies
a99b87a628 Tests/RunCMake/CXXModules: add a test for issue #25112
2870a67540 Tests/FortranOnly: add a test case for issue #25112
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8645
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index f4bb8b1..a50ce11 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -525,6 +525,12 @@ 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. @@ -1147,8 +1153,12 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry) this->AddItem(BT<std::string>(libName, item.Backtrace)); } } else if (tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) { - // Ignore object library! - // Its object-files should already have been extracted for linking. + 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); + } } else { // Decide whether to use an import library. cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(config) |