summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-05-29 18:55:45 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-03 14:20:23 (GMT)
commit9fd602bfd33479b1acecd40e5c1b76ce37d59798 (patch)
treef2370c6b6f736fa6b8cb2ce72f1934b4c43de212 /Source/cmGeneratorExpressionNode.cxx
parentec66af2026e085e7b648b222794f0f213183ea1e (diff)
downloadCMake-9fd602bfd33479b1acecd40e5c1b76ce37d59798.zip
CMake-9fd602bfd33479b1acecd40e5c1b76ce37d59798.tar.gz
CMake-9fd602bfd33479b1acecd40e5c1b76ce37d59798.tar.bz2
Genex: PlatformId now can match against a list of ids.
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 7fcd3f3..4744309 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -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";
}