浏览代码

VS: Use "call " keyword with .cmd and .bat file custom commands (#12445)

Similar fix to commit d093abef for the Makefile generators. Prevents
premature exit from sequence of commands. Even when no errors occur,
the previous construct without "call " was exiting the sequence before
executing the full set of commands...
David Cole 14 年之前
父节点
当前提交
46c70540ed
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      Source/cmLocalVisualStudioGenerator.cxx

+ 14 - 0
Source/cmLocalVisualStudioGenerator.cxx

@@ -250,6 +250,20 @@ cmLocalVisualStudioGenerator
 
     // Add this command line.
     std::string cmd = ccg.GetCommand(c);
+
+    // Use "call " before any invocations of .bat or .cmd files
+    // invoked as custom commands.
+    //
+    std::string suffix;
+    if (cmd.size() > 4)
+      {
+      suffix = cmSystemTools::LowerCase(cmd.substr(cmd.size()-4));
+      if (suffix == ".bat" || suffix == ".cmd")
+        {
+        script += "call ";
+        }
+      }
+
     script += this->Convert(cmd.c_str(), relativeRoot, SHELL);
     ccg.AppendArguments(c, script);