cmcmd.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 cmcmd_h
  4. #define cmcmd_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCryptoHash.h"
  7. #include <string>
  8. #include <vector>
  9. class cmcmd
  10. {
  11. public:
  12. /**
  13. * Execute commands during the build process. Supports options such
  14. * as echo, remove file etc.
  15. */
  16. static int ExecuteCMakeCommand(std::vector<std::string>&);
  17. // define co-compile command handlers they must be public
  18. // because they are used in a std::function map
  19. static int HandleIWYU(const std::string& runCmd,
  20. const std::string& sourceFile,
  21. const std::vector<std::string>& orig_cmd);
  22. static int HandleTidy(const std::string& runCmd,
  23. const std::string& sourceFile,
  24. const std::vector<std::string>& orig_cmd);
  25. static int HandleLWYU(const std::string& runCmd,
  26. const std::string& sourceFile,
  27. const std::vector<std::string>& orig_cmd);
  28. static int HandleCppLint(const std::string& runCmd,
  29. const std::string& sourceFile,
  30. const std::vector<std::string>& orig_cmd);
  31. static int HandleCppCheck(const std::string& runCmd,
  32. const std::string& sourceFile,
  33. const std::vector<std::string>& orig_cmd);
  34. protected:
  35. static int HandleCoCompileCommands(std::vector<std::string>& args);
  36. static int HashSumFile(std::vector<std::string>& args,
  37. cmCryptoHash::Algo algo);
  38. static int SymlinkLibrary(std::vector<std::string>& args);
  39. static int SymlinkExecutable(std::vector<std::string>& args);
  40. static bool SymlinkInternal(std::string const& file,
  41. std::string const& link);
  42. static int ExecuteEchoColor(std::vector<std::string>& args);
  43. static int ExecuteLinkScript(std::vector<std::string>& args);
  44. static int WindowsCEEnvironment(const char* version,
  45. const std::string& name);
  46. static int VisualStudioLink(std::vector<std::string>& args, int type);
  47. };
  48. #endif