Genex: Extend cmGeneratorExpressionContext constructor.

Initialize the members in the appropriate place.
This commit is contained in:
Stephen Kelly 2015-02-22 21:41:06 +01:00
parent 082b6a9d78
commit ec428fafcf
3 changed files with 29 additions and 16 deletions

View File

@ -72,19 +72,10 @@ const char *cmCompiledGeneratorExpression::Evaluate(
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
std::string const& language) const std::string const& language) const
{ {
cmGeneratorExpressionContext context; cmGeneratorExpressionContext context(mf, config, quiet, headTarget,
context.Makefile = mf; currentTarget ? currentTarget : headTarget,
context.Config = config; this->EvaluateForBuildsystem,
context.Quiet = quiet; this->Backtrace, language);
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;
return this->EvaluateWithContext(context, dagChecker); return this->EvaluateWithContext(context, dagChecker);
} }

View File

@ -12,7 +12,23 @@
#include "cmGeneratorExpressionContext.h" #include "cmGeneratorExpressionContext.h"
cmGeneratorExpressionContext::cmGeneratorExpressionContext(); cmGeneratorExpressionContext::cmGeneratorExpressionContext(
: Backtrace(NULL) cmMakefile* mf, std::string const& config,
bool quiet, cmTarget const* headTarget,
cmTarget const* currentTarget,
bool evaluateForBuildsystem,
cmListFileBacktrace const& backtrace,
std::string const& language)
: Backtrace(backtrace),
Makefile(mf),
Config(config),
Language(language),
HeadTarget(headTarget),
CurrentTarget(currentTarget),
Quiet(quiet),
HadError(false),
HadContextSensitiveCondition(false),
HadHeadSensitiveCondition(false),
EvaluateForBuildsystem(evaluateForBuildsystem)
{ {
} }

View File

@ -23,7 +23,13 @@ class cmTarget;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
struct cmGeneratorExpressionContext struct cmGeneratorExpressionContext
{ {
cmGeneratorExpressionContext(); cmGeneratorExpressionContext(cmMakefile* mf, std::string const& config,
bool quiet, cmTarget const* headTarget,
cmTarget const* currentTarget,
bool evaluateForBuildsystem,
cmListFileBacktrace const& backtrace,
std::string const& language);
cmListFileBacktrace Backtrace; cmListFileBacktrace Backtrace;
std::set<cmTarget*> DependTargets; std::set<cmTarget*> DependTargets;