cmCustomCommandGenerator.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 cmCustomCommandGenerator_h
  4. #define cmCustomCommandGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCustomCommandLines.h"
  7. #include <string>
  8. #include <vector>
  9. class cmCustomCommand;
  10. class cmLocalGenerator;
  11. class cmCustomCommandGenerator
  12. {
  13. cmCustomCommand const& CC;
  14. std::string Config;
  15. cmLocalGenerator* LG;
  16. bool OldStyle;
  17. bool MakeVars;
  18. cmCustomCommandLines CommandLines;
  19. std::vector<std::vector<std::string>> EmulatorsWithArguments;
  20. std::vector<std::string> Byproducts;
  21. std::vector<std::string> Depends;
  22. std::string WorkingDirectory;
  23. void FillEmulatorsWithArguments();
  24. std::vector<std::string> GetCrossCompilingEmulator(unsigned int c) const;
  25. const char* GetArgv0Location(unsigned int c) const;
  26. public:
  27. cmCustomCommandGenerator(cmCustomCommand const& cc, std::string config,
  28. cmLocalGenerator* lg);
  29. cmCustomCommandGenerator(const cmCustomCommandGenerator&) = delete;
  30. cmCustomCommandGenerator& operator=(const cmCustomCommandGenerator&) =
  31. delete;
  32. cmCustomCommand const& GetCC() const { return this->CC; }
  33. unsigned int GetNumberOfCommands() const;
  34. std::string GetCommand(unsigned int c) const;
  35. void AppendArguments(unsigned int c, std::string& cmd) const;
  36. const char* GetComment() const;
  37. std::string GetWorkingDirectory() const;
  38. std::vector<std::string> const& GetOutputs() const;
  39. std::vector<std::string> const& GetByproducts() const;
  40. std::vector<std::string> const& GetDepends() const;
  41. bool HasOnlyEmptyCommandLines() const;
  42. };
  43. #endif