RPATH computation for imported library with .tbd assumes runtime artifact is also available
In !8536 (merged), logic was added to handle RPATH computation when the imported library has a text-based stub (i.e. a linker import library). The relevant code looks like this (e.g. see here):
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 a target has only a .tbd
file and no real library, as might be the case with a library provided by a SDK, there will be no runtime binary artifact to query. This should not be an error, but currently the above call to tgt->GetFullPath()
will raise a fatal error, complaining that IMPORTED_LOCATION
isn't set.