resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmMSVC60LinkLineComputer.cxx
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3
4 #include "cmMSVC60LinkLineComputer.h"
5
6 #if defined(_WIN32) && !defined(__CYGWIN__)
7 #  include "cmSystemTools.h"
8 #endif
9
10 class cmOutputConverter;
11
12 cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer(
13   cmOutputConverter* outputConverter, cmStateDirectory const& stateDir)
14   : cmLinkLineComputer(outputConverter, stateDir)
15 {
16 }
17
18 std::string cmMSVC60LinkLineComputer::ConvertToLinkReference(
19   std::string const& lib) const
20 {
21 #if defined(_WIN32) && !defined(__CYGWIN__)
22   // Work-ardound command line parsing limitations in MSVC 6.0
23   // Search for the last space.
24   std::string::size_type pos = lib.rfind(' ');
25   if (pos != std::string::npos) {
26     // Find the slash after the last space, if any.
27     pos = lib.find('/', pos);
28
29     // Convert the portion of the path with a space to a short path.
30     std::string sp;
31     if (cmSystemTools::GetShortPath(lib.substr(0, pos).c_str(), sp)) {
32       // Append the rest of the path with no space.
33       sp += lib.substr(pos);
34       return sp;
35     }
36   }
37 #endif
38
39   return this->cmLinkLineComputer::ConvertToLinkReference(lib);
40 }