Ninja: don't break because of empty commands
This commit is contained in:
parent
128fe5d504
commit
c60557e973
|
@ -225,10 +225,17 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
|
||||||
const cmNinjaDeps& deps,
|
const cmNinjaDeps& deps,
|
||||||
const cmNinjaDeps& orderOnlyDeps)
|
const cmNinjaDeps& orderOnlyDeps)
|
||||||
{
|
{
|
||||||
|
std::string cmd = command;
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (cmd.empty())
|
||||||
|
// TODO Shouldn't an empty command be handled by ninja?
|
||||||
|
cmd = "cmd.exe /c";
|
||||||
|
#endif
|
||||||
|
|
||||||
this->AddCustomCommandRule();
|
this->AddCustomCommandRule();
|
||||||
|
|
||||||
cmNinjaVars vars;
|
cmNinjaVars vars;
|
||||||
vars["COMMAND"] = command;
|
vars["COMMAND"] = cmd;
|
||||||
vars["DESC"] = EncodeLiteral(description);
|
vars["DESC"] = EncodeLiteral(description);
|
||||||
|
|
||||||
cmGlobalNinjaGenerator::WriteBuild(*this->BuildFileStream,
|
cmGlobalNinjaGenerator::WriteBuild(*this->BuildFileStream,
|
||||||
|
|
Loading…
Reference in New Issue