mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmTarget: Future-proof AddLinkLibrary target lookup scope
The `AddLinkLibrary` method takes a `cmMakefile` pointer to represent the scope of the caller that wants to link to the named library. Currently in all call sites this is the same as the target's `Makefile` member, but in principle the library named by the caller is visible in its scope so we should use the `cmMakefile` it provided to look up the library target.
This commit is contained in:
+1
-1
@@ -745,7 +745,7 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
|
||||
void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib,
|
||||
cmTargetLinkLibraryType llt)
|
||||
{
|
||||
cmTarget* tgt = this->Makefile->FindTargetToUse(lib);
|
||||
cmTarget* tgt = mf.FindTargetToUse(lib);
|
||||
{
|
||||
const bool isNonImportedTarget = tgt && !tgt->IsImported();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user