summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorShannon Booth <shannon.ml.booth@gmail.com>2020-12-22 23:57:50 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-23 14:59:03 (GMT)
commitd43f4692e0c5e6f71305be74fbed7c6120057d9d (patch)
tree2a696060ac2ea23dbca178c79dc1f4cd184e8ef6 /Source
parentc56d3bef3e6b105465c41cc241ab26cce2327393 (diff)
downloadCMake-d43f4692e0c5e6f71305be74fbed7c6120057d9d.zip
CMake-d43f4692e0c5e6f71305be74fbed7c6120057d9d.tar.gz
CMake-d43f4692e0c5e6f71305be74fbed7c6120057d9d.tar.bz2
Ninja: Omit custom commands with an empty COMMAND
Fixes: #21063
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index b035f70..5a747e5 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -557,9 +557,13 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(
std::string launcher = this->MakeCustomLauncher(ccg);
for (unsigned i = 0; i != ccg.GetNumberOfCommands(); ++i) {
+ std::string c = ccg.GetCommand(i);
+ if (c.empty()) {
+ continue;
+ }
cmdLines.push_back(launcher +
this->ConvertToOutputFormat(
- ccg.GetCommand(i),
+ c,
gg->IsMultiConfig() ? cmOutputConverter::NINJAMULTI
: cmOutputConverter::SHELL));