cmLinkLineComputer.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 cmLinkLineComputer_h
  4. #define cmLinkLineComputer_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmStateDirectory.h"
  9. class cmComputeLinkInformation;
  10. class cmGeneratorTarget;
  11. class cmOutputConverter;
  12. template <typename T>
  13. class BT;
  14. class cmLinkLineComputer
  15. {
  16. public:
  17. cmLinkLineComputer(cmOutputConverter* outputConverter,
  18. cmStateDirectory const& stateDir);
  19. virtual ~cmLinkLineComputer();
  20. cmLinkLineComputer(cmLinkLineComputer const&) = delete;
  21. cmLinkLineComputer& operator=(cmLinkLineComputer const&) = delete;
  22. void SetUseWatcomQuote(bool useWatcomQuote);
  23. void SetForResponse(bool forResponse);
  24. void SetRelink(bool relink);
  25. virtual std::string ConvertToLinkReference(std::string const& input) const;
  26. std::string ComputeLinkPath(cmComputeLinkInformation& cli,
  27. std::string const& libPathFlag,
  28. std::string const& libPathTerminator);
  29. void ComputeLinkPath(cmComputeLinkInformation& cli,
  30. std::string const& libPathFlag,
  31. std::string const& libPathTerminator,
  32. std::vector<BT<std::string>>& linkPath);
  33. std::string ComputeFrameworkPath(cmComputeLinkInformation& cli,
  34. std::string const& fwSearchFlag);
  35. std::string ComputeLinkLibraries(cmComputeLinkInformation& cli,
  36. std::string const& stdLibString);
  37. virtual void ComputeLinkLibraries(
  38. cmComputeLinkInformation& cli, std::string const& stdLibString,
  39. std::vector<BT<std::string>>& linkLibraries);
  40. virtual std::string GetLinkerLanguage(cmGeneratorTarget* target,
  41. std::string const& config);
  42. protected:
  43. std::string ComputeLinkLibs(cmComputeLinkInformation& cli);
  44. void ComputeLinkLibs(cmComputeLinkInformation& cli,
  45. std::vector<BT<std::string>>& linkLibraries);
  46. std::string ComputeRPath(cmComputeLinkInformation& cli);
  47. std::string ConvertToOutputFormat(std::string const& input);
  48. std::string ConvertToOutputForExisting(std::string const& input);
  49. cmStateDirectory StateDir;
  50. cmOutputConverter* OutputConverter;
  51. bool ForResponse;
  52. bool UseWatcomQuote;
  53. bool Relink;
  54. };
  55. #endif