cmMSVC60LinkLineComputer.cxx 1.1 KB

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