diff options
author | Brad King <brad.king@kitware.com> | 2014-06-16 14:10:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-23 13:17:07 (GMT) |
commit | a272344228174958a8b2346793d3272eb432dad8 (patch) | |
tree | f780c36052e86269948024d64f3d368a3570ad2d /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | 069d60fe039ae1d797a26786f3cd4c23afc27b07 (diff) | |
download | CMake-a272344228174958a8b2346793d3272eb432dad8.zip CMake-a272344228174958a8b2346793d3272eb432dad8.tar.gz CMake-a272344228174958a8b2346793d3272eb432dad8.tar.bz2 |
Fix scope of transitive target name lookups
In cmTarget, cmGeneratorTarget, and cmGeneratorExpressionEvaluator, fix
target name lookups to occur in the cmMakefile context of the target
that referenced the name, not the current 'head' target. The context
matters for imported targets because they are directory-scoped instead
of globally unique. We already do this in cmComputeLinkDepends and
cmComputeTargetDepends.
Extend the InterfaceLibrary test with an example covering this behavior.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 3dee601..f491882 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -828,7 +828,7 @@ std::string getLinkedTargetsContent( sep = ";"; } cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString); - std::string linkedTargetsContent = cge->Evaluate(context->Makefile, + std::string linkedTargetsContent = cge->Evaluate(target->GetMakefile(), context->Config, context->Quiet, headTarget, @@ -853,7 +853,7 @@ std::string getLinkedTargetsContent(const std::vector<std::string> &libraries, it = libraries.begin(); it != libraries.end(); ++it) { - if (cmTarget const *tgt = context->Makefile->FindTargetToUse(*it)) + if (cmTarget const *tgt = target->FindTargetToLink(*it)) { tgts.push_back(tgt); } |