summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 745a749..57beb72 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -128,6 +128,16 @@ struct BooleanOpNode : public cmGeneratorExpressionNode
int NumExpectedParameters() const override { return OneOrMoreParameters; }
+ bool ShouldEvaluateNextParameter(const std::vector<std::string>& parameters,
+ std::string& def_value) const override
+ {
+ if (!parameters.empty() && parameters[0] == failureVal) {
+ def_value = failureVal;
+ return false;
+ }
+ return true;
+ }
+
std::string Evaluate(const std::vector<std::string>& parameters,
cmGeneratorExpressionContext* context,
const GeneratorExpressionContent* content,
@@ -195,6 +205,13 @@ static const struct IfNode : public cmGeneratorExpressionNode
int NumExpectedParameters() const override { return 3; }
+ bool ShouldEvaluateNextParameter(const std::vector<std::string>& parameters,
+ std::string&) const override
+ {
+ return (parameters.empty() ||
+ parameters[0] != cmStrCat(parameters.size() - 1, ""));
+ }
+
std::string Evaluate(const std::vector<std::string>& parameters,
cmGeneratorExpressionContext* context,
const GeneratorExpressionContent* content,