cmFunctionCommand.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmFunctionCommand_h
  4. #define cmFunctionCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmCommand.h"
  9. #include "cmFunctionBlocker.h"
  10. #include "cmListFileCache.h"
  11. class cmExecutionStatus;
  12. class cmMakefile;
  13. class cmFunctionFunctionBlocker : public cmFunctionBlocker
  14. {
  15. public:
  16. cmFunctionFunctionBlocker() { this->Depth = 0; }
  17. ~cmFunctionFunctionBlocker() override {}
  18. bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
  19. cmExecutionStatus&) override;
  20. bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
  21. std::vector<std::string> Args;
  22. std::vector<cmListFileFunction> Functions;
  23. int Depth;
  24. };
  25. /// Starts function() ... endfunction() block
  26. class cmFunctionCommand : public cmCommand
  27. {
  28. public:
  29. /**
  30. * This is a virtual constructor for the command.
  31. */
  32. cmCommand* Clone() override { return new cmFunctionCommand; }
  33. /**
  34. * This is called when the command is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. bool InitialPass(std::vector<std::string> const& args,
  38. cmExecutionStatus& status) override;
  39. };
  40. #endif