summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-07 18:13:35 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-07 18:13:35 (GMT)
commit1c70c6cc09f0f8be087db2aeae5ee6a3f1b47bda (patch)
tree03b0e04577ae759204750a2534548b42a6ac3b59 /Source/cmMakefile.cxx
parent2b7baed719e4a6eb918ed6f22ee6031a40b7f316 (diff)
downloadCMake-1c70c6cc09f0f8be087db2aeae5ee6a3f1b47bda.zip
CMake-1c70c6cc09f0f8be087db2aeae5ee6a3f1b47bda.tar.gz
CMake-1c70c6cc09f0f8be087db2aeae5ee6a3f1b47bda.tar.bz2
cmMakefile: Use public API to find a target
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f2db37e..ae2d776 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1220,8 +1220,8 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
const std::string& lib,
cmTargetLinkLibraryType llt)
{
- cmTargets::iterator i = this->Targets.find(target);
- if (i == this->Targets.end()) {
+ cmTarget* t = this->FindLocalNonAliasTarget(target);
+ if (!t) {
std::ostringstream e;
e << "Attempt to add link library \"" << lib << "\" to target \"" << target
<< "\" which is not built in this directory.";
@@ -1242,7 +1242,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
<< "to executables with the ENABLE_EXPORTS property set.";
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)