فهرست منبع

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
Brad King 1 سال پیش
والد
کامیت
b38000d774
1فایلهای تغییر یافته به همراه15 افزوده شده و 1 حذف شده
  1. 15 1
      Source/cmGlobalXCodeGenerator.cxx

+ 15 - 1
Source/cmGlobalXCodeGenerator.cxx

@@ -267,7 +267,21 @@ cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(const std::string& name,
 namespace {
 namespace {
 std::string ConvertToMakefilePath(std::string const& path)
 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;
 }
 }
 }
 }