cmMSVC60LinkLineComputer.cxx 1.2 KB

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