cmFunctionCommand.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 "cm_memory.hxx"
  9. #include "cmCommand.h"
  10. #include "cmFunctionBlocker.h"
  11. #include "cmListFileCache.h"
  12. class cmExecutionStatus;
  13. class cmMakefile;
  14. class cmFunctionFunctionBlocker : public cmFunctionBlocker
  15. {
  16. public:
  17. bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
  18. cmExecutionStatus&) override;
  19. bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
  20. std::vector<std::string> Args;
  21. std::vector<cmListFileFunction> Functions;
  22. int Depth = 0;
  23. };
  24. /// Starts function() ... endfunction() block
  25. class cmFunctionCommand : public cmCommand
  26. {
  27. public:
  28. /**
  29. * This is a virtual constructor for the command.
  30. */
  31. std::unique_ptr<cmCommand> Clone() override
  32. {
  33. return cm::make_unique<cmFunctionCommand>();
  34. }
  35. /**
  36. * This is called when the command is first encountered in
  37. * the CMakeLists.txt file.
  38. */
  39. bool InitialPass(std::vector<std::string> const& args,
  40. cmExecutionStatus& status) override;
  41. };
  42. #endif