Explorar o código

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.
Brad King %!s(int64=7) %!d(string=hai) anos
pai
achega
9bbae5ae28
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Source/cmTarget.cxx

+ 1 - 1
Source/cmTarget.cxx

@@ -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();