summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-16 16:41:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-08-16 16:42:21 (GMT)
commitea73a8ea38d2709d046b8228ffbe4f9f644fb6e0 (patch)
tree68d7cc808af1a8aac09fbf290efd4970cfe3f907 /Source/cmExportFileGenerator.cxx
parentdb1a284611abf444855f7607c9b930455ffc957e (diff)
parent0ebff0d61acf27c077545a36ee83526cef22e1fc (diff)
downloadCMake-ea73a8ea38d2709d046b8228ffbe4f9f644fb6e0.zip
CMake-ea73a8ea38d2709d046b8228ffbe4f9f644fb6e0.tar.gz
CMake-ea73a8ea38d2709d046b8228ffbe4f9f644fb6e0.tar.bz2
Merge topic 'export-no-shdeps'
0ebff0d61a export: Restore exclusion of private shared library dependencies from checks Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7557
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 23b5690..50bc78c 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -843,9 +843,16 @@ void cmExportFileGenerator::SetImportDetailProperties(
suffix, target, "IMPORTED_LINK_INTERFACE_LANGUAGES", iface->Languages,
properties, ImportLinkPropertyTargetNames::No);
+ // Export IMPORTED_LINK_DEPENDENT_LIBRARIES to help consuming linkers
+ // find private dependencies of shared libraries.
+ std::size_t oldMissingTargetsSize = this->MissingTargets.size();
this->SetImportLinkProperty(
suffix, target, "IMPORTED_LINK_DEPENDENT_LIBRARIES", iface->SharedDeps,
properties, ImportLinkPropertyTargetNames::Yes);
+ // Avoid enforcing shared library private dependencies as public package
+ // dependencies by ignoring missing targets added for them.
+ this->MissingTargets.resize(oldMissingTargetsSize);
+
if (iface->Multiplicity > 0) {
std::string prop =
cmStrCat("IMPORTED_LINK_INTERFACE_MULTIPLICITY", suffix);