cmMSVC60LinkLineComputer.cxx 1.0 KB

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