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