cmMSVC60LinkLineComputer.cxx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 "cmMSVC60LinkLineComputer.h"
  4. #if defined(_WIN32) && !defined(__CYGWIN__)
  5. #include "cmSystemTools.h"
  6. #endif
  7. class cmOutputConverter;
  8. cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer(
  9. cmOutputConverter* outputConverter, cmStateDirectory const& stateDir)
  10. : cmLinkLineComputer(outputConverter, stateDir)
  11. {
  12. }
  13. std::string cmMSVC60LinkLineComputer::ConvertToLinkReference(
  14. std::string const& lib) const
  15. {
  16. #if defined(_WIN32) && !defined(__CYGWIN__)
  17. // Work-ardound command line parsing limitations in MSVC 6.0
  18. // Search for the last space.
  19. std::string::size_type pos = lib.rfind(' ');
  20. if (pos != std::string::npos) {
  21. // Find the slash after the last space, if any.
  22. pos = lib.find('/', pos);
  23. // Convert the portion of the path with a space to a short path.
  24. std::string sp;
  25. if (cmSystemTools::GetShortPath(lib.substr(0, pos).c_str(), sp)) {
  26. // Append the rest of the path with no space.
  27. sp += lib.substr(pos);
  28. return sp;
  29. }
  30. }
  31. #endif
  32. return cmLinkLineComputer::ConvertToLinkReference(lib);
  33. }