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:
parent
8e1bbee4d9
commit
46c70540ed
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue