separate_arguments: Fix crash on *_COMMAND with no arguments

Fixes: #21320
This commit is contained in:
Robert Bozzetto
2020-10-16 12:00:47 +11:00
committed by Brad King
parent b1d9a25f35
commit 747f80fe82
4 changed files with 20 additions and 0 deletions

View File

@@ -80,6 +80,11 @@ bool cmSeparateArgumentsCommand(std::vector<std::string> const& args,
return false;
}
if (unparsedArguments.empty()) {
status.GetMakefile().AddDefinition(var, {});
return true;
}
std::string& command = unparsedArguments.front();
if (command.empty()) {