cmLinkLineComputer.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 "cmStateDirectory.h"
  8. #include "cmValue.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 SetUseNinjaMulti(bool useNinjaMulti);
  24. void SetForResponse(bool forResponse);
  25. void SetRelink(bool relink);
  26. virtual std::string ConvertToLinkReference(std::string const& input) const;
  27. std::string ComputeLinkPath(cmComputeLinkInformation& cli,
  28. std::string const& libPathFlag,
  29. std::string const& libPathTerminator);
  30. void ComputeLinkPath(cmComputeLinkInformation& cli,
  31. std::string const& libPathFlag,
  32. std::string const& libPathTerminator,
  33. std::vector<BT<std::string>>& linkPath);
  34. std::string ComputeFrameworkPath(cmComputeLinkInformation& cli,
  35. cmValue fwSearchFlag,
  36. cmValue sysFwSearchFlag);
  37. std::string ComputeLinkLibraries(cmComputeLinkInformation& cli,
  38. std::string const& stdLibString);
  39. virtual void ComputeLinkLibraries(
  40. cmComputeLinkInformation& cli, std::string const& stdLibString,
  41. std::vector<BT<std::string>>& linkLibraries);
  42. virtual std::string GetLinkerLanguage(cmGeneratorTarget* target,
  43. std::string const& config);
  44. protected:
  45. std::string ComputeLinkLibs(cmComputeLinkInformation& cli);
  46. void ComputeLinkLibs(cmComputeLinkInformation& cli,
  47. std::vector<BT<std::string>>& linkLibraries);
  48. std::string ComputeRPath(cmComputeLinkInformation& cli);
  49. std::string ConvertToOutputFormat(std::string const& input);
  50. std::string ConvertToOutputForExisting(std::string const& input);
  51. cmStateDirectory StateDir;
  52. cmOutputConverter* OutputConverter;
  53. bool ForResponse = false;
  54. bool UseWatcomQuote = false;
  55. bool UseNinjaMulti = false;
  56. bool Relink = false;
  57. };