瀏覽代碼

Ninja: ninja can't read dep. pathes with parentheses

Peter Kuemmel 13 年之前
父節點
當前提交
12cc6434bf
共有 1 個文件被更改,包括 3 次插入6 次删除
  1. 3 6
      Source/cmcldeps.cxx

+ 3 - 6
Source/cmcldeps.cxx

@@ -578,8 +578,8 @@ static void outputDepFile(const string& dfile, const string& objfile,
     tmp = *i;
     doEscape(tmp, "\\", "/");
     doEscape(tmp, " ", "\\ ");
-    //doEscape(tmp, "(", "("); // TODO ninja cant read ( and )
-    //doEscape(tmp, ")", ")");
+    //doEscape(tmp, "(", "\\("); // TODO ninja can't read ( and )
+    //doEscape(tmp, ")", "\\)");
     fprintf(out, "%s \\\n", tmp.c_str());
   }
 
@@ -637,12 +637,9 @@ int main() {
   string line;
   vector<string> includes;
   bool isFirstLine = true; // cl prints always first the source filename
-  std::string sysHeadersCamel =    "Program Files (x86)\\Microsoft ";
-  std::string sysHeadersLower = "program files (x86)\\microsoft ";
   while (getline(ss, line)) {
     if (startsWith(line, prefix)) {
-       if (!contains(line, sysHeadersCamel)
-           && !contains(line, sysHeadersLower)) {
+       if (!contains(line, "(") && !contains(line, ")")) {
         string inc = trimLeadingSpace(line.substr(prefix.size()).c_str());
         if (inc[inc.size() - 1] == '\r') // blech, stupid \r\n
           inc = inc.substr(0, inc.size() - 1);