cmake/Source/cmMSVC60LinkLineComputer.cxx

41 lines
1.2 KiB
C++
Raw Normal View History

2017-04-14 19:02:05 +02:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMSVC60LinkLineComputer.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
2018-08-09 18:06:22 +02:00
# include "cmSystemTools.h"
2017-04-14 19:02:05 +02:00
#endif
class cmOutputConverter;
cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer(
2017-07-20 19:35:53 +02:00
cmOutputConverter* outputConverter, cmStateDirectory const& stateDir)
2017-04-14 19:02:05 +02:00
: cmLinkLineComputer(outputConverter, stateDir)
{
}
std::string cmMSVC60LinkLineComputer::ConvertToLinkReference(
std::string const& lib) const
{
#if defined(_WIN32) && !defined(__CYGWIN__)
// Work-ardound command line parsing limitations in MSVC 6.0
// Search for the last space.
std::string::size_type pos = lib.rfind(' ');
2017-07-20 19:35:53 +02:00
if (pos != std::string::npos) {
2017-04-14 19:02:05 +02:00
// Find the slash after the last space, if any.
pos = lib.find('/', pos);
// Convert the portion of the path with a space to a short path.
std::string sp;
if (cmSystemTools::GetShortPath(lib.substr(0, pos).c_str(), sp)) {
// Append the rest of the path with no space.
sp += lib.substr(pos);
return sp;
}
}
#endif
2021-09-14 00:13:48 +02:00
return this->cmLinkLineComputer::ConvertToLinkReference(lib);
2017-04-14 19:02:05 +02:00
}