diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-06-23 13:18:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-24 12:38:28 (GMT) |
commit | eae15dce6a3fdb9b02c86891553e5cf408401672 (patch) | |
tree | 64cf6df050ff8eb423b86d2744bb6a0c80043fca /Source/cmGeneratorExpressionNode.cxx | |
parent | c4cc21d20b79d682a99cc28957cf973ebf1993ff (diff) | |
download | CMake-eae15dce6a3fdb9b02c86891553e5cf408401672.zip CMake-eae15dce6a3fdb9b02c86891553e5cf408401672.tar.gz CMake-eae15dce6a3fdb9b02c86891553e5cf408401672.tar.bz2 |
Genex: $<CONFIG:> now supports multiple configurations
Instead of having to do $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>
you can do $<CONFIG:Release,MinSizeRel>
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 3e0c21c..b712b71 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -881,7 +881,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode { ConfigurationTestNode() {} // NOLINT(modernize-use-equals-default) - int NumExpectedParameters() const override { return OneOrZeroParameters; } + int NumExpectedParameters() const override { return ZeroOrMoreParameters; } std::string Evaluate( const std::vector<std::string>& parameters, @@ -899,13 +899,15 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode return std::string(); } context->HadContextSensitiveCondition = true; - if (context->Config.empty()) { - return parameters.front().empty() ? "1" : "0"; - } - - if (cmsysString_strcasecmp(parameters.front().c_str(), - context->Config.c_str()) == 0) { - return "1"; + for (auto& param : parameters) { + if (context->Config.empty()) { + if (param.empty()) { + return "1"; + } + } else if (cmsysString_strcasecmp(param.c_str(), + context->Config.c_str()) == 0) { + return "1"; + } } if (context->CurrentTarget && context->CurrentTarget->IsImported()) { @@ -922,10 +924,12 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode "MAP_IMPORTED_CONFIG_", cmSystemTools::UpperCase(context->Config)); if (cmProp mapValue = context->CurrentTarget->GetProperty(mapProp)) { cmExpandList(cmSystemTools::UpperCase(*mapValue), mappedConfigs); - return cm::contains(mappedConfigs, - cmSystemTools::UpperCase(parameters.front())) - ? "1" - : "0"; + + for (auto& param : parameters) { + if (cm::contains(mappedConfigs, cmSystemTools::UpperCase(param))) { + return "1"; + } + } } } } |