summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-19 14:25:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-19 14:26:30 (GMT)
commitf4e6dfe55d27305a5896c65bb5be8010aa0ff3ec (patch)
tree1380e548b2dbabc623fa8b4ca37840151971139f /Source
parentae1ca3034e7d54f95f242c67f044437987f8ce1d (diff)
parent747f80fe82b6045fca006ece601b2189bc547aac (diff)
downloadCMake-f4e6dfe55d27305a5896c65bb5be8010aa0ff3ec.zip
CMake-f4e6dfe55d27305a5896c65bb5be8010aa0ff3ec.tar.gz
CMake-f4e6dfe55d27305a5896c65bb5be8010aa0ff3ec.tar.bz2
Merge topic 'separate_arguments-no-args' into release-3.19
747f80fe82 separate_arguments: Fix crash on *_COMMAND with no arguments Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5382
Diffstat (limited to 'Source')
-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()) {