summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-12-01 13:57:28 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-12-01 13:57:28 (GMT)
commit22b72b189400c1a50030b59c378ebb68460ac7db (patch)
tree1370b3167da43fd982bcf28c2f3496f62f9518e7 /Source/cmGeneratorExpressionEvaluator.cxx
parent9f59caa9bd1aba3de27aa2fbab89b56c6b99d9b9 (diff)
parent672f1001c015bf5f531d8731dba30a5fb856edea (diff)
downloadCMake-22b72b189400c1a50030b59c378ebb68460ac7db.zip
CMake-22b72b189400c1a50030b59c378ebb68460ac7db.tar.gz
CMake-22b72b189400c1a50030b59c378ebb68460ac7db.tar.bz2
Merge topic 'fix-transitive-OBJECT_SOURCES-context'
672f1001 Genex: Fix evaluation context propagation for TARGET_OBJECTS.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx74
1 files changed, 40 insertions, 34 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index b0258f6..17adad7 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -69,9 +69,42 @@ struct cmGeneratorExpressionNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker
) const = 0;
+
+ static std::string EvaluateDependentExpression(
+ std::string const& prop, cmMakefile *makefile,
+ cmGeneratorExpressionContext *context,
+ cmTarget const* headTarget, cmTarget const* currentTarget,
+ cmGeneratorExpressionDAGChecker *dagChecker);
};
//----------------------------------------------------------------------------
+std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
+ std::string const& prop, cmMakefile *makefile,
+ cmGeneratorExpressionContext *context,
+ cmTarget const* headTarget, cmTarget const* currentTarget,
+ cmGeneratorExpressionDAGChecker *dagChecker)
+{
+ cmGeneratorExpression ge(&context->Backtrace);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+ cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
+ std::string result = cge->Evaluate(makefile,
+ context->Config,
+ context->Quiet,
+ headTarget,
+ currentTarget,
+ dagChecker);
+ if (cge->GetHadContextSensitiveCondition())
+ {
+ context->HadContextSensitiveCondition = true;
+ }
+ if (cge->GetHadHeadSensitiveCondition())
+ {
+ context->HadHeadSensitiveCondition = true;
+ }
+ return result;
+}
+
+//----------------------------------------------------------------------------
static const struct ZeroNode : public cmGeneratorExpressionNode
{
ZeroNode() {}
@@ -825,22 +858,10 @@ getLinkedTargetsContent(
}
if(!depString.empty())
{
- cmGeneratorExpression ge(&context->Backtrace);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString);
- linkedTargetsContent = cge->Evaluate(target->GetMakefile(),
- context->Config,
- context->Quiet,
- headTarget,
- target,
- dagChecker);
- if (cge->GetHadContextSensitiveCondition())
- {
- context->HadContextSensitiveCondition = true;
- }
- if (cge->GetHadHeadSensitiveCondition())
- {
- context->HadHeadSensitiveCondition = true;
- }
+ linkedTargetsContent =
+ cmGeneratorExpressionNode::EvaluateDependentExpression(depString,
+ target->GetMakefile(), context,
+ headTarget, target, dagChecker);
}
linkedTargetsContent =
cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent);
@@ -1185,24 +1206,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if(!interfacePropertyName.empty())
{
- cmGeneratorExpression ge(&context->Backtrace);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
- cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
- std::string result = cge->Evaluate(context->Makefile,
- context->Config,
- context->Quiet,
- headTarget,
- target,
- &dagChecker);
-
- if (cge->GetHadContextSensitiveCondition())
- {
- context->HadContextSensitiveCondition = true;
- }
- if (cge->GetHadHeadSensitiveCondition())
- {
- context->HadHeadSensitiveCondition = true;
- }
+ std::string result = this->EvaluateDependentExpression(prop,
+ context->Makefile, context,
+ headTarget, target, &dagChecker);
if (!linkedTargetsContent.empty())
{
result += (result.empty() ? "" : ";") + linkedTargetsContent;