summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-03 22:36:23 (GMT)
committerBrad King <brad.king@kitware.com>2012-10-09 12:26:48 (GMT)
commit354face4fa234adfe6f056dc9d3039fc135ab4ef (patch)
tree2f596552a017a62af5afdc0f536ae0bd7e03551b /Source/cmGeneratorExpressionEvaluator.cxx
parent8b3b88abd82a36daf541dfa7094f978e0be08efc (diff)
downloadCMake-354face4fa234adfe6f056dc9d3039fc135ab4ef.zip
CMake-354face4fa234adfe6f056dc9d3039fc135ab4ef.tar.gz
CMake-354face4fa234adfe6f056dc9d3039fc135ab4ef.tar.bz2
GenEx: Ensure that the empty CONFIGURATION can be used conditionally.
The CONFIGURATION can not be manipulated at unit testing time, so this is not unit tested further.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 12809f4..93895b3 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -237,11 +237,6 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *) const
{
- if (!context->Config)
- {
- return std::string();
- }
-
cmsys::RegularExpression configValidator;
configValidator.compile("^[A-Za-z0-9_]*$");
if (!configValidator.find(parameters.begin()->c_str()))
@@ -250,6 +245,11 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
"Expression syntax not recognized.");
return std::string();
}
+ if (!context->Config)
+ {
+ return parameters.front().empty() ? "1" : "0";
+ }
+
return *parameters.begin() == context->Config ? "1" : "0";
}
} configurationTestNode;