cmLinkLineComputer.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 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. std::string const& fwSearchFlag);
  36. std::string ComputeLinkLibraries(cmComputeLinkInformation& cli,
  37. std::string const& stdLibString);
  38. virtual void ComputeLinkLibraries(
  39. cmComputeLinkInformation& cli, std::string const& stdLibString,
  40. std::vector<BT<std::string>>& linkLibraries);
  41. virtual std::string GetLinkerLanguage(cmGeneratorTarget* target,
  42. std::string const& config);
  43. protected:
  44. std::string ComputeLinkLibs(cmComputeLinkInformation& cli);
  45. void ComputeLinkLibs(cmComputeLinkInformation& cli,
  46. std::vector<BT<std::string>>& linkLibraries);
  47. std::string ComputeRPath(cmComputeLinkInformation& cli);
  48. std::string ConvertToOutputFormat(std::string const& input);
  49. std::string ConvertToOutputForExisting(std::string const& input);
  50. cmStateDirectory StateDir;
  51. cmOutputConverter* OutputConverter;
  52. bool ForResponse;
  53. bool UseWatcomQuote;
  54. bool UseNinjaMulti;
  55. bool Relink;
  56. };
  57. #endif