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.
This commit is contained in:
Stephen Kelly 2012-10-04 00:36:23 +02:00 committed by Brad King
parent 8b3b88abd8
commit 354face4fa
1 changed files with 5 additions and 5 deletions

View File

@ -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;