summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-12 19:26:45 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-03-12 19:26:45 (GMT)
commit6390d5f5cb107dcc4a0bc6124ab5f17370dcadcd (patch)
tree63a42b18d2e151f28d69915cdd85955039e3999a /Source/cmGeneratorExpression.cxx
parent0d58b082d00b8dc0fc678911e6e3c489c0bd5a9a (diff)
parentec428fafcf9f50c54b163dd16f68063cc387f779 (diff)
downloadCMake-6390d5f5cb107dcc4a0bc6124ab5f17370dcadcd.zip
CMake-6390d5f5cb107dcc4a0bc6124ab5f17370dcadcd.tar.gz
CMake-6390d5f5cb107dcc4a0bc6124ab5f17370dcadcd.tar.bz2
Merge topic 'refactor-cmGeneratorExpression'
ec428faf Genex: Extend cmGeneratorExpressionContext constructor. 082b6a9d Genex: Split cmGeneratorExpressionContext into own file. 9df1f0fc Genex: Split cmGeneratorExpressionNode into own file. 80b9f0cb Genex: Extract an evaluateWithContext method. 642048ce Help: Move docs of $<0:...> and $<1:...> to output section.
Diffstat (limited to 'Source/cmGeneratorExpression.cxx')
-rw-r--r--Source/cmGeneratorExpression.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index b72c269..a1c405b 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -73,6 +73,19 @@ const char *cmCompiledGeneratorExpression::Evaluate(
cmGeneratorExpressionDAGChecker *dagChecker,
std::string const& language) const
{
+ cmGeneratorExpressionContext context(mf, config, quiet, headTarget,
+ currentTarget ? currentTarget : headTarget,
+ this->EvaluateForBuildsystem,
+ this->Backtrace, language);
+
+ return this->EvaluateWithContext(context, dagChecker);
+}
+
+//----------------------------------------------------------------------------
+const char* cmCompiledGeneratorExpression::EvaluateWithContext(
+ cmGeneratorExpressionContext& context,
+ cmGeneratorExpressionDAGChecker *dagChecker) const
+{
if (!this->NeedsEvaluation)
{
return this->Input.c_str();
@@ -85,20 +98,6 @@ const char *cmCompiledGeneratorExpression::Evaluate(
const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end
= this->Evaluators.end();
- cmGeneratorExpressionContext context;
- context.Makefile = mf;
- context.Config = config;
- context.Quiet = quiet;
- context.HadError = false;
- context.HadContextSensitiveCondition = false;
- context.HadHeadSensitiveCondition = false;
- context.SourceSensitiveTargets.clear();
- context.HeadTarget = headTarget;
- context.EvaluateForBuildsystem = this->EvaluateForBuildsystem;
- context.CurrentTarget = currentTarget ? currentTarget : headTarget;
- context.Backtrace = this->Backtrace;
- context.Language = language;
-
for ( ; it != end; ++it)
{
this->Output += (*it)->Evaluate(&context, dagChecker);