Genex: PlatformId now can match against a list of ids.

This commit is contained in:
Robert Maynard
2019-05-29 14:55:45 -04:00
committed by Brad King
parent ec66af2026
commit 9fd602bfd3
4 changed files with 15 additions and 6 deletions

View File

@@ -776,7 +776,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
{
PlatformIdNode() {} // 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,
@@ -794,8 +794,10 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
return parameters.front().empty() ? "1" : "0";
}
if (parameters.front() == platformId) {
return "1";
for (auto& param : parameters) {
if (param == platformId) {
return "1";
}
}
return "0";
}