瀏覽代碼

Fix failing ExternalProject test on Borland dashboards.

If there is a .bat or .cmd file used as a custom command
then the Borland Makefiles generator (specifically) requires
using the "call " syntax before the name of the .bat or .cmd
file. This fix applies to all Makefile based generators where
WindowsShell is true.
David Cole 15 年之前
父節點
當前提交
d093abef7e
共有 1 個文件被更改,包括 22 次插入0 次删除
  1. 22 0
      Source/cmLocalUnixMakefileGenerator3.cxx

+ 22 - 0
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -973,6 +973,24 @@ cmLocalUnixMakefileGenerator3
                                       this->ConfigurationName.c_str());
     if (cmd.size())
       {
+      // Use "call " before any invocations of .bat or .cmd files
+      // invoked as custom commands in the WindowsShell.
+      //
+      bool useCall = false;
+
+      if (this->WindowsShell)
+        {
+        std::string suffix;
+        if (cmd.size() > 4)
+          {
+          suffix = cmSystemTools::LowerCase(cmd.substr(cmd.size()-4));
+          if (suffix == ".bat" || suffix == ".cmd")
+            {
+            useCall = true;
+            }
+          }
+        }
+
       cmSystemTools::ReplaceString(cmd, "/./", "/");
       // Convert the command to a relative path only if the current
       // working directory will be the start-output directory.
@@ -1044,6 +1062,10 @@ cmLocalUnixMakefileGenerator3
             }
           }
         }
+      if (useCall && launcher.empty())
+        {
+        cmd = "call " + cmd;
+        }
       commands1.push_back(cmd);
       }
     }