Kaynağa Gözat

Ninja: fix usage of cldeps with ctest launchers

Mathias Gaunard 13 yıl önce
ebeveyn
işleme
9fc2e20244
1 değiştirilmiş dosya ile 9 ekleme ve 7 silme
  1. 9 7
      Source/cmNinjaTargetGenerator.cxx

+ 9 - 7
Source/cmNinjaTargetGenerator.cxx

@@ -423,17 +423,19 @@ cmNinjaTargetGenerator
   std::vector<std::string> compileCmds;
   cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
 
+  if(useClDeps)
+    {
+    std::string cmdPrefix = clDepsBinary + lang + " $in \"$DEP_FILE\" $out " +
+                            clShowPrefix + clBinary;
+    compileCmds.front().insert(0, cmdPrefix);
+    }
+
   for (std::vector<std::string>::iterator i = compileCmds.begin();
        i != compileCmds.end(); ++i)
     this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
 
-  std::string cmdLine;
-  if(useClDeps)
-    {
-    cmdLine = clDepsBinary + lang + " $in \"$DEP_FILE\" $out " +
-              clShowPrefix + clBinary;
-    }
-  cmdLine += this->GetLocalGenerator()->BuildCommandLine(compileCmds);
+  std::string cmdLine =
+    this->GetLocalGenerator()->BuildCommandLine(compileCmds);
 
 
   // Write the rule for compiling file of the given language.