cmLinkLineComputer.cxx 712 B

123456789101112131415161718192021222324252627
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmLinkLineComputer.h"
  4. #include "cmOutputConverter.h"
  5. cmLinkLineComputer::cmLinkLineComputer(cmState::Directory stateDir)
  6. : StateDir(stateDir)
  7. {
  8. }
  9. cmLinkLineComputer::~cmLinkLineComputer()
  10. {
  11. }
  12. std::string cmLinkLineComputer::ConvertToLinkReference(
  13. std::string const& lib) const
  14. {
  15. std::string relLib = lib;
  16. if (cmOutputConverter::ContainedInDirectory(
  17. this->StateDir.GetCurrentBinary(), lib, this->StateDir)) {
  18. relLib = cmOutputConverter::ForceToRelativePath(
  19. this->StateDir.GetCurrentBinary(), lib);
  20. }
  21. return relLib;
  22. }