CMake/Source/cmGeneratorExpressionNode.h
Kitware Robot 0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00

60 lines
1.8 KiB
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
class cmGeneratorTarget;
class cmLocalGenerator;
struct GeneratorExpressionContent;
struct cmGeneratorExpressionContext;
struct cmGeneratorExpressionDAGChecker;
struct cmGeneratorExpressionNode
{
enum
{
DynamicParameters = 0,
OneOrMoreParameters = -1,
TwoOrMoreParameters = -2,
ZeroOrMoreParameters = -3,
OneOrZeroParameters = -4
};
virtual ~cmGeneratorExpressionNode() = default;
virtual bool GeneratesContent() const { return true; }
virtual bool RequiresLiteralInput() const { return false; }
virtual bool AcceptsArbitraryContentParameter() const { return false; }
virtual int NumExpectedParameters() const { return 1; }
virtual bool ShouldEvaluateNextParameter(std::vector<std::string> const&,
std::string&) const
{
return true;
}
virtual std::string Evaluate(
std::vector<std::string> const& parameters,
cmGeneratorExpressionContext* context,
GeneratorExpressionContent const* content,
cmGeneratorExpressionDAGChecker* dagChecker) const = 0;
static std::string EvaluateDependentExpression(
std::string const& prop, cmLocalGenerator* lg,
cmGeneratorExpressionContext* context, cmGeneratorTarget const* headTarget,
cmGeneratorExpressionDAGChecker* dagChecker,
cmGeneratorTarget const* currentTarget);
static cmGeneratorExpressionNode const* GetNode(
std::string const& identifier);
};
void reportError(cmGeneratorExpressionContext* context,
std::string const& expr, std::string const& result);