From d233030f5bcfe2509b82433f7df6383cd301e34e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 16 Oct 2015 19:19:49 +0200 Subject: [PATCH] cmGeneratorTarget: Port implementation to cmGeneratorTarget. --- Source/cmGeneratorTarget.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 994fcb1f8..52ae31017 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/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; } //----------------------------------------------------------------------------