summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2012-06-05 23:36:34 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-06-05 23:36:34 (GMT)
commitc60557e973643c5d60da17911d096f7ac88996c2 (patch)
tree5f32e7842269acadbc5a025e179a1b6a54d268da /Source
parent128fe5d504196ab82dde5a7dfe0ffb031b03e590 (diff)
downloadCMake-c60557e973643c5d60da17911d096f7ac88996c2.zip
CMake-c60557e973643c5d60da17911d096f7ac88996c2.tar.gz
CMake-c60557e973643c5d60da17911d096f7ac88996c2.tar.bz2
Ninja: don't break because of empty commands
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index a91aa15..5477adf 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -225,10 +225,17 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
const cmNinjaDeps& deps,
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();
cmNinjaVars vars;
- vars["COMMAND"] = command;
+ vars["COMMAND"] = cmd;
vars["DESC"] = EncodeLiteral(description);
cmGlobalNinjaGenerator::WriteBuild(*this->BuildFileStream,