cmRuntimeDependencyArchive.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 cmRuntimeDependencyArchive_h
  4. #define cmRuntimeDependencyArchive_h
  5. #include "cmBinUtilsLinker.h"
  6. #include "cmsys/RegularExpression.hxx"
  7. #include <map>
  8. #include <memory>
  9. #include <set>
  10. #include <string>
  11. #include <vector>
  12. class cmCommand;
  13. class cmMakefile;
  14. class cmRuntimeDependencyArchive
  15. {
  16. public:
  17. explicit cmRuntimeDependencyArchive(
  18. cmCommand* command, std::vector<std::string> searchDirectories,
  19. std::string bundleExecutable,
  20. const std::vector<std::string>& preIncludeRegexes,
  21. const std::vector<std::string>& preExcludeRegexes,
  22. const std::vector<std::string>& postIncludeRegexes,
  23. const std::vector<std::string>& postExcludeRegexes);
  24. bool Prepare();
  25. bool GetRuntimeDependencies(const std::vector<std::string>& executables,
  26. const std::vector<std::string>& libraries,
  27. const std::vector<std::string>& modules);
  28. void SetError(const std::string& e);
  29. std::string GetBundleExecutable();
  30. const std::vector<std::string>& GetSearchDirectories();
  31. std::string GetGetRuntimeDependenciesTool();
  32. bool GetGetRuntimeDependenciesCommand(const std::string& search,
  33. std::vector<std::string>& command);
  34. bool IsPreExcluded(const std::string& name);
  35. bool IsPostExcluded(const std::string& name);
  36. void AddResolvedPath(const std::string& name, const std::string& path,
  37. bool& unique);
  38. void AddUnresolvedPath(const std::string& name);
  39. cmMakefile* GetMakefile();
  40. const std::map<std::string, std::set<std::string>>& GetResolvedPaths();
  41. const std::set<std::string>& GetUnresolvedPaths();
  42. private:
  43. cmCommand* Command;
  44. std::unique_ptr<cmBinUtilsLinker> Linker;
  45. std::string GetRuntimeDependenciesTool;
  46. std::vector<std::string> GetRuntimeDependenciesCommand;
  47. std::vector<std::string> SearchDirectories;
  48. std::string BundleExecutable;
  49. std::vector<cmsys::RegularExpression> PreIncludeRegexes;
  50. std::vector<cmsys::RegularExpression> PreExcludeRegexes;
  51. std::vector<cmsys::RegularExpression> PostIncludeRegexes;
  52. std::vector<cmsys::RegularExpression> PostExcludeRegexes;
  53. std::map<std::string, std::set<std::string>> ResolvedPaths;
  54. std::set<std::string> UnresolvedPaths;
  55. };
  56. #endif // cmRuntimeDependencyArchive_h