diff options
author | Leonid Pospelov <pospelovlm@yandex.ru> | 2019-04-15 00:36:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-04-22 14:41:28 (GMT) |
commit | 20d7c5631e88d80cb683a5e120c0c1e1f077945a (patch) | |
tree | 934421741f2abd4e5241a826c96dd2c5d409fedc /Source/cmGeneratorExpressionNode.cxx | |
parent | abd62201bd7d10f8eb27229ac3f5e55d52d0659e (diff) | |
download | CMake-20d7c5631e88d80cb683a5e120c0c1e1f077945a.zip CMake-20d7c5631e88d80cb683a5e120c0c1e1f077945a.tar.gz CMake-20d7c5631e88d80cb683a5e120c0c1e1f077945a.tar.bz2 |
cmGeneratorExpressionNode: add CharacterNode
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 38da8ef..a665974 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -599,9 +599,10 @@ static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode } } makeCIdentifierNode; -static const struct Angle_RNode : public cmGeneratorExpressionNode +template <char C> +struct CharacterNode : public cmGeneratorExpressionNode { - Angle_RNode() {} // NOLINT(modernize-use-equals-default) + CharacterNode() {} // NOLINT(modernize-use-equals-default) int NumExpectedParameters() const override { return 0; } @@ -611,41 +612,12 @@ static const struct Angle_RNode : public cmGeneratorExpressionNode const GeneratorExpressionContent* /*content*/, cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override { - return ">"; + return { C }; } -} angle_rNode; - -static const struct CommaNode : public cmGeneratorExpressionNode -{ - CommaNode() {} // NOLINT(modernize-use-equals-default) - - int NumExpectedParameters() const override { return 0; } - - std::string Evaluate( - const std::vector<std::string>& /*parameters*/, - cmGeneratorExpressionContext* /*context*/, - const GeneratorExpressionContent* /*content*/, - cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override - { - return ","; - } -} commaNode; - -static const struct SemicolonNode : public cmGeneratorExpressionNode -{ - SemicolonNode() {} // NOLINT(modernize-use-equals-default) - - int NumExpectedParameters() const override { return 0; } - - std::string Evaluate( - const std::vector<std::string>& /*parameters*/, - cmGeneratorExpressionContext* /*context*/, - const GeneratorExpressionContent* /*content*/, - cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override - { - return ";"; - } -} semicolonNode; +}; +static const CharacterNode<'>'> angle_rNode; +static const CharacterNode<','> commaNode; +static const CharacterNode<';'> semicolonNode; struct CompilerIdNode : public cmGeneratorExpressionNode { |