cmBinUtilsMacOSMachOLinker.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 <memory>
  5. #include <string>
  6. #include <vector>
  7. #include "cmBinUtilsLinker.h"
  8. #include "cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h"
  9. #include "cmStateTypes.h"
  10. class cmRuntimeDependencyArchive;
  11. class cmBinUtilsMacOSMachOLinker : public cmBinUtilsLinker
  12. {
  13. public:
  14. cmBinUtilsMacOSMachOLinker(cmRuntimeDependencyArchive* archive);
  15. bool Prepare() override;
  16. bool ScanDependencies(std::string const& file,
  17. cmStateEnums::TargetType type) override;
  18. private:
  19. std::unique_ptr<cmBinUtilsMacOSMachOGetRuntimeDependenciesTool> Tool;
  20. bool ScanDependencies(std::string const& file,
  21. std::vector<std::string> const& libs,
  22. std::vector<std::string> const& rpaths,
  23. std::string const& executablePath);
  24. bool GetFileDependencies(std::vector<std::string> const& names,
  25. std::string const& executablePath,
  26. std::string const& loaderPath,
  27. std::vector<std::string> const& rpaths);
  28. bool ResolveDependency(std::string const& name,
  29. std::string const& executablePath,
  30. std::string const& loaderPath,
  31. std::vector<std::string> const& rpaths,
  32. std::string& path, bool& resolved);
  33. bool ResolveExecutablePathDependency(std::string const& name,
  34. std::string const& executablePath,
  35. std::string& path, bool& resolved);
  36. bool ResolveLoaderPathDependency(std::string const& name,
  37. std::string const& loaderPath,
  38. std::string& path, bool& resolved);
  39. bool ResolveRPathDependency(std::string const& name,
  40. std::string const& executablePath,
  41. std::string const& loaderPath,
  42. std::vector<std::string> const& rpaths,
  43. std::string& path, bool& resolved);
  44. };