summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGeneratorExpressionNode.cxx2
-rw-r--r--Tests/RunCMake/GeneratorExpressionShortCircuit/GoodAND.cmake3
-rw-r--r--Tests/RunCMake/GeneratorExpressionShortCircuit/GoodOR.cmake2
3 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 57beb72..c8147b2 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -131,7 +131,7 @@ struct BooleanOpNode : public cmGeneratorExpressionNode
bool ShouldEvaluateNextParameter(const std::vector<std::string>& parameters,
std::string& def_value) const override
{
- if (!parameters.empty() && parameters[0] == failureVal) {
+ if (!parameters.empty() && parameters.back() == failureVal) {
def_value = failureVal;
return false;
}
diff --git a/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodAND.cmake b/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodAND.cmake
index 26bcaba..1827343 100644
--- a/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodAND.cmake
+++ b/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodAND.cmake
@@ -1,4 +1,7 @@
set(error $<0>)
add_custom_target(check ALL COMMAND check
$<AND:0,${error}>
+ $<AND:0,1,${error}>
+ $<AND:1,0,${error}>
+ $<AND:0,0,${error}>
)
diff --git a/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodOR.cmake b/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodOR.cmake
index b574937..db2fd52 100644
--- a/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodOR.cmake
+++ b/Tests/RunCMake/GeneratorExpressionShortCircuit/GoodOR.cmake
@@ -1,4 +1,6 @@
set(error $<0>)
add_custom_target(check ALL COMMAND check
$<OR:1,${error}>
+ $<OR:0,1,${error}>
+ $<OR:1,0,${error}>
)