mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 03:11:08 -06:00
cmGlobalXCodeGenerator: Re-implement legacy makefile path escaping
Apply commit d74e651b78 (Makefiles: Re-implement makefile target path
escaping and quoting, 2020-04-10, v3.18.0-rc1~334^2~1) to the Xcode
generator's legacy Makefile generation. This adds support for '#'.
However, since we use '$(VAR)' placeholders, do not escape '$'.
Issue: #25604
This commit is contained in:
@@ -267,7 +267,21 @@ cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(const std::string& name,
|
||||
namespace {
|
||||
std::string ConvertToMakefilePath(std::string const& path)
|
||||
{
|
||||
return cmSystemTools::ConvertToOutputPath(path);
|
||||
std::string result;
|
||||
result.reserve(path.size());
|
||||
for (char c : path) {
|
||||
switch (c) {
|
||||
case '\\':
|
||||
case ' ':
|
||||
case '#':
|
||||
result.push_back('\\');
|
||||
CM_FALLTHROUGH;
|
||||
default:
|
||||
result.push_back(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user