diff options
author | Brad King <brad.king@kitware.com> | 2018-09-06 20:49:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-07 13:23:43 (GMT) |
commit | 1b57f49586afc9e8663d5e146732b1cd0597e7ef (patch) | |
tree | 3754c4403d6b5cc3f5e6b2543f6e1f394dc92ea7 /Source/cmGeneratorExpression.cxx | |
parent | bea390e9bd68e1aa7d86b6aef7384f502c39068c (diff) | |
download | CMake-1b57f49586afc9e8663d5e146732b1cd0597e7ef.zip CMake-1b57f49586afc9e8663d5e146732b1cd0597e7ef.tar.gz CMake-1b57f49586afc9e8663d5e146732b1cd0597e7ef.tar.bz2 |
genex: Simplify cmGeneratorExpressionInterpreter
All callers were constructing with a non-empty target name using the
target whose pointer was passed anyway. Drop this argument. Simplify
logic accordingly. Re-order constructor arguments to match the
cmCompiledGeneratorExpression::Evaluate arguments.
Also remove unnecessary getters.
Diffstat (limited to 'Source/cmGeneratorExpression.cxx')
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 6823cd5..6d83a3f 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -13,6 +13,7 @@ #include "cmGeneratorExpressionEvaluator.h" #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" +#include "cmGeneratorTarget.h" #include "cmSystemTools.h" cmGeneratorExpression::cmGeneratorExpression( @@ -389,14 +390,16 @@ void cmCompiledGeneratorExpression::GetMaxLanguageStandard( const std::string& cmGeneratorExpressionInterpreter::Evaluate( const char* expression, const std::string& property) { - if (this->Target.empty()) { - return this->EvaluateExpression(expression); - } + this->CompiledGeneratorExpression = + this->GeneratorExpression.Parse(expression); // Specify COMPILE_OPTIONS to DAGchecker, same semantic as COMPILE_FLAGS cmGeneratorExpressionDAGChecker dagChecker( - this->Target, property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property, - nullptr, nullptr); + this->HeadTarget->GetName(), + property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property, nullptr, + nullptr); - return this->EvaluateExpression(expression, &dagChecker); + return this->CompiledGeneratorExpression->Evaluate( + this->LocalGenerator, this->Config, false, this->HeadTarget, &dagChecker, + this->Language); } |