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...
This commit is contained in:
David Cole 2011-11-18 10:15:58 -05:00
parent 8e1bbee4d9
commit 46c70540ed
1 changed files with 14 additions and 0 deletions

View File

@ -250,6 +250,20 @@ cmLocalVisualStudioGenerator
// Add this command line. // Add this command line.
std::string cmd = ccg.GetCommand(c); 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); script += this->Convert(cmd.c_str(), relativeRoot, SHELL);
ccg.AppendArguments(c, script); ccg.AppendArguments(c, script);