Merge topic 'ninja-quoted-cmd-commands'
b6f1142
Ninja: multiple commands must be quoted
This commit is contained in:
commit
48e476c3f4
|
@ -292,16 +292,32 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
|
||||||
|
|
||||||
cmOStringStream cmd;
|
cmOStringStream cmd;
|
||||||
for (std::vector<std::string>::const_iterator li = cmdLines.begin();
|
for (std::vector<std::string>::const_iterator li = cmdLines.begin();
|
||||||
li != cmdLines.end(); ++li) {
|
li != cmdLines.end(); ++li)
|
||||||
if (li != cmdLines.begin()) {
|
|
||||||
cmd << " && ";
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
} else if (cmdLines.size() > 1) {
|
{
|
||||||
cmd << "cmd.exe /c ";
|
if (li != cmdLines.begin())
|
||||||
#endif
|
{
|
||||||
}
|
cmd << " && ";
|
||||||
|
}
|
||||||
|
else if (cmdLines.size() > 1)
|
||||||
|
{
|
||||||
|
cmd << "cmd.exe /C \"";
|
||||||
|
}
|
||||||
cmd << *li;
|
cmd << *li;
|
||||||
}
|
}
|
||||||
|
if (cmdLines.size() > 1)
|
||||||
|
{
|
||||||
|
cmd << "\"";
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
if (li != cmdLines.begin())
|
||||||
|
{
|
||||||
|
cmd << " && ";
|
||||||
|
}
|
||||||
|
cmd << *li;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return cmd.str();
|
return cmd.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue