diff options
author | Brad King <brad.king@kitware.com> | 2023-06-06 13:55:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-06-06 13:55:34 (GMT) |
commit | 53d923439515e385f1cb66b5aff2cd14eedce136 (patch) | |
tree | 773bb738256f2a0a6e04d37827633861cf17035a /Source | |
parent | 1ad77d7029f7d34e2fa20e98267f84a6891e7707 (diff) | |
parent | bfa5b430b33d7d6ad5c71829c8fe60ca57e3f4e7 (diff) | |
download | CMake-53d923439515e385f1cb66b5aff2cd14eedce136.zip CMake-53d923439515e385f1cb66b5aff2cd14eedce136.tar.gz CMake-53d923439515e385f1cb66b5aff2cd14eedce136.tar.bz2 |
Merge topic 'Apple-tbd-runpath-handling'
bfa5b430b3 Apple text-based stubs: ensure runpath is correctly defined
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8536
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 5d44a6a..b80b3cb 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1175,7 +1175,14 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry) LinkEntry libEntry{ entry }; libEntry.Item = lib; this->AddTargetItem(libEntry); - this->AddLibraryRuntimeInfo(lib.Value, tgt); + if (tgt->IsApple() && tgt->HasImportLibrary(config)) { + // Use the library rather than the tbd file for runpath computation + this->AddLibraryRuntimeInfo( + tgt->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact, true), + tgt); + } else { + this->AddLibraryRuntimeInfo(lib.Value, tgt); + } if (tgt && tgt->GetType() == cmStateEnums::SHARED_LIBRARY && this->Target->IsDLLPlatform()) { this->AddRuntimeDLL(tgt); @@ -1261,7 +1268,15 @@ void cmComputeLinkInformation::AddSharedDepItem(LinkEntry const& entry) ? cmStateEnums::ImportLibraryArtifact : cmStateEnums::RuntimeBinaryArtifact; lib = tgt->GetFullPath(this->Config, artifact); - this->AddLibraryRuntimeInfo(lib, tgt); + if (tgt->IsApple() && tgt->HasImportLibrary(this->Config)) { + // Use the library rather than the tbd file for runpath computation + this->AddLibraryRuntimeInfo( + tgt->GetFullPath(this->Config, cmStateEnums::RuntimeBinaryArtifact, + true), + tgt); + } else { + this->AddLibraryRuntimeInfo(lib, tgt); + } } else { lib = item.Value; this->AddLibraryRuntimeInfo(lib); |