Commit 1c70c6cc authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmMakefile: Use public API to find a target

parent 2b7baed7
...@@ -1220,8 +1220,8 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, ...@@ -1220,8 +1220,8 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
const std::string& lib, const std::string& lib,
cmTargetLinkLibraryType llt) cmTargetLinkLibraryType llt)
{ {
cmTargets::iterator i = this->Targets.find(target); cmTarget* t = this->FindLocalNonAliasTarget(target);
if (i == this->Targets.end()) { if (!t) {
std::ostringstream e; std::ostringstream e;
e << "Attempt to add link library \"" << lib << "\" to target \"" << target e << "Attempt to add link library \"" << lib << "\" to target \"" << target
<< "\" which is not built in this directory."; << "\" which is not built in this directory.";
...@@ -1242,7 +1242,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, ...@@ -1242,7 +1242,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
<< "to executables with the ENABLE_EXPORTS property set."; << "to executables with the ENABLE_EXPORTS property set.";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
} }
i->second.AddLinkLibrary(*this, target, lib, llt); t->AddLinkLibrary(*this, target, lib, llt);
} }
void cmMakefile::InitializeFromParent(cmMakefile* parent) void cmMakefile::InitializeFromParent(cmMakefile* parent)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment