cmake/Source/cmGeneratorExpressionNode.h

54 lines
1.6 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2015-08-17 11:37:30 +02:00
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2015-08-17 11:37:30 +02:00
2016-10-30 18:24:19 +01:00
#include <string>
#include <vector>
2015-08-17 11:37:30 +02:00
2016-10-30 18:24:19 +01:00
class cmGeneratorTarget;
class cmLocalGenerator;
struct GeneratorExpressionContent;
struct cmGeneratorExpressionContext;
struct cmGeneratorExpressionDAGChecker;
2015-08-17 11:37:30 +02:00
struct cmGeneratorExpressionNode
{
2016-07-09 11:21:54 +02:00
enum
{
2015-08-17 11:37:30 +02:00
DynamicParameters = 0,
OneOrMoreParameters = -1,
2019-11-11 23:01:05 +01:00
TwoOrMoreParameters = -2,
ZeroOrMoreParameters = -3,
OneOrZeroParameters = -4
2015-08-17 11:37:30 +02:00
};
2019-11-11 23:01:05 +01:00
virtual ~cmGeneratorExpressionNode() = default;
2015-08-17 11:37:30 +02:00
virtual bool GeneratesContent() const { return true; }
virtual bool RequiresLiteralInput() const { return false; }
2016-07-09 11:21:54 +02:00
virtual bool AcceptsArbitraryContentParameter() const { return false; }
2015-08-17 11:37:30 +02:00
virtual int NumExpectedParameters() const { return 1; }
2016-07-09 11:21:54 +02:00
virtual std::string Evaluate(
const std::vector<std::string>& parameters,
cmGeneratorExpressionContext* context,
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* dagChecker) const = 0;
2015-08-17 11:37:30 +02:00
static std::string EvaluateDependentExpression(
2016-07-09 11:21:54 +02:00
std::string const& prop, cmLocalGenerator* lg,
cmGeneratorExpressionContext* context, const cmGeneratorTarget* headTarget,
2020-02-01 23:06:01 +01:00
cmGeneratorExpressionDAGChecker* dagChecker,
const cmGeneratorTarget* currentTarget);
2015-08-17 11:37:30 +02:00
static const cmGeneratorExpressionNode* GetNode(
2016-07-09 11:21:54 +02:00
const std::string& identifier);
2015-08-17 11:37:30 +02:00
};
2016-07-09 11:21:54 +02:00
void reportError(cmGeneratorExpressionContext* context,
const std::string& expr, const std::string& result);