summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-05-14 15:54:37 (GMT)
committerBrad King <brad.king@kitware.com>2018-05-14 15:59:51 (GMT)
commit813bcc2997a5692e8d9e141cf12b662b8b4dfbac (patch)
tree1123388bb1cc446ee138dcabf17d01b3f0b2f8c1 /Source
parent7b62ec2451f9c7ff0a58dd447e6906c02ac4dc24 (diff)
parent6e594916592e5f8f17b387546d79e484ac092b9e (diff)
downloadCMake-813bcc2997a5692e8d9e141cf12b662b8b4dfbac.zip
CMake-813bcc2997a5692e8d9e141cf12b662b8b4dfbac.tar.gz
CMake-813bcc2997a5692e8d9e141cf12b662b8b4dfbac.tar.bz2
Merge branch 'custom-command-expand-empty' into release-3.11
Merge-request: !2074
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCustomCommandGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 136cf39..6c9f9d6 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -40,6 +40,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
argv.push_back(std::move(parsed_arg));
}
}
+
+ // Later code assumes at least one entry exists, but expanding
+ // lists on an empty command may have left this empty.
+ // FIXME: Should we define behavior for removing empty commands?
+ if (argv.empty()) {
+ argv.push_back(std::string());
+ }
+
this->CommandLines.push_back(std::move(argv));
}