summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-12 01:06:16 (GMT)
committerBrad King <brad.king@kitware.com>2024-01-04 16:59:26 (GMT)
commit2c6ec6de1521b1e82f2bd5ac3324f6953ac31f4d (patch)
tree1dbff1ddd17d156442894ebbb0bab50fa7db32d2 /Source/cmComputeLinkInformation.cxx
parentdd4a6dff9246715b419a8daf4ced2d3c46a529df (diff)
downloadCMake-2c6ec6de1521b1e82f2bd5ac3324f6953ac31f4d.zip
CMake-2c6ec6de1521b1e82f2bd5ac3324f6953ac31f4d.tar.gz
CMake-2c6ec6de1521b1e82f2bd5ac3324f6953ac31f4d.tar.bz2
Link to transitive dependencies on stub libraries only on some linkers
Only linkers that enforce `--no-allow-shlib-undefined` recursively need to link private transitive dependencies on stub libraries explicitly.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index d9d8ec1..de7f02e 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1340,7 +1340,8 @@ void cmComputeLinkInformation::AddSharedDepItem(LinkEntry const& entry)
// If the linker also uses '--as-needed' behavior, this will not
// add an unnecessary direct dependency.
(tgt && tgt->IsImported() &&
- !tgt->HasKnownRuntimeArtifactLocation(this->Config))) {
+ !tgt->HasKnownRuntimeArtifactLocation(this->Config) &&
+ this->Target->LinkerEnforcesNoAllowShLibUndefined(this->Config))) {
this->AddItem(entry);
return;
}