Selaa lähdekoodia

cmGeneratorTarget: Port implementation to cmGeneratorTarget.

Stephen Kelly 10 vuotta sitten
vanhempi
sitoutus
d233030f5b
1 muutettua tiedostoa jossa 5 lisäystä ja 8 poistoa
  1. 5 8
      Source/cmGeneratorTarget.cxx

+ 5 - 8
Source/cmGeneratorTarget.cxx

@@ -5483,13 +5483,14 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
 cmGeneratorTarget*
 cmGeneratorTarget::FindTargetToLink(std::string const& name) const
 {
-  cmTarget const* tgt = this->Makefile->FindTargetToUse(name);
+  cmGeneratorTarget* tgt =
+      this->LocalGenerator->FindGeneratorTargetToUse(name);
 
   // Skip targets that will not really be linked.  This is probably a
   // name conflict between an external library and an executable
   // within the project.
   if(tgt && tgt->GetType() == cmState::EXECUTABLE &&
-     !tgt->IsExecutableWithExports())
+     !tgt->Target->IsExecutableWithExports())
     {
     tgt = 0;
     }
@@ -5502,17 +5503,13 @@ cmGeneratorTarget::FindTargetToLink(std::string const& name) const
       "allowed.  "
       "One may link only to STATIC or SHARED libraries, or to executables "
       "with the ENABLE_EXPORTS property set.";
-    cmake* cm = this->Makefile->GetCMakeInstance();
+    cmake* cm = this->LocalGenerator->GetCMakeInstance();
     cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
                      this->Target->GetBacktrace());
     tgt = 0;
     }
 
-  if (!tgt)
-    {
-    return 0;
-    }
-  return this->GlobalGenerator->GetGeneratorTarget(tgt);
+  return tgt;
 }
 
 //----------------------------------------------------------------------------