summaryrefslogtreecommitdiffstats
path: root/Source/cmSeparateArgumentsCommand.cxx
diff options
context:
space:
mode:
authorRobert Bozzetto <towrang@outlook.com>2020-10-16 01:00:47 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-16 12:49:28 (GMT)
commit747f80fe82b6045fca006ece601b2189bc547aac (patch)
tree01ab89f6e9a4eccc3bd1d00d9baef73c89be5e95 /Source/cmSeparateArgumentsCommand.cxx
parentb1d9a25f35a22f41b2c1b87725f091936711a28c (diff)
downloadCMake-747f80fe82b6045fca006ece601b2189bc547aac.zip
CMake-747f80fe82b6045fca006ece601b2189bc547aac.tar.gz
CMake-747f80fe82b6045fca006ece601b2189bc547aac.tar.bz2
separate_arguments: Fix crash on *_COMMAND with no arguments
Fixes: #21320
Diffstat (limited to 'Source/cmSeparateArgumentsCommand.cxx')
-rw-r--r--Source/cmSeparateArgumentsCommand.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx
index 7e501a2..52b1a44 100644
--- a/Source/cmSeparateArgumentsCommand.cxx
+++ b/Source/cmSeparateArgumentsCommand.cxx
@@ -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()) {