cmGeneratorTarget: Port implementation to cmGeneratorTarget.

This commit is contained in:
Stephen Kelly 2015-10-16 19:19:49 +02:00
parent 0ebe2bbf4a
commit d233030f5b
1 changed files with 5 additions and 8 deletions

View File

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