summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorJuan Ramos <juan.ramos@kitware.com>2024-05-15 20:58:47 (GMT)
committerJuan Ramos <juan.ramos@kitware.com>2024-05-16 16:00:30 (GMT)
commitf9028379f727c3134edf287ab8836358fd4bd5e9 (patch)
tree8ebbcf8ae1399be783d5c6885d1d2bee96caeeca /Source/cmAddCustomCommandCommand.cxx
parent96028ad95c21029a261d49de5a788f385e18c380 (diff)
downloadCMake-f9028379f727c3134edf287ab8836358fd4bd5e9.zip
CMake-f9028379f727c3134edf287ab8836358fd4bd5e9.tar.gz
CMake-f9028379f727c3134edf287ab8836358fd4bd5e9.tar.bz2
cmAddCustomCommandCommand: Move SOURCE signature error messages
Helps readability of the code. All the SOURCE signature code is in the else statement.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index ea97287..d943011 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -357,13 +357,18 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
cc->SetDepends(depends);
cc->SetImplicitDepends(implicit_depends);
mf.AddCustomCommandToOutput(std::move(cc));
- } else if (!byproducts.empty()) {
- status.SetError("BYPRODUCTS may not be specified with SOURCE signatures");
- return false;
- } else if (uses_terminal) {
- status.SetError("USES_TERMINAL may not be used with SOURCE signatures");
- return false;
} else {
+ if (!byproducts.empty()) {
+ status.SetError(
+ "BYPRODUCTS may not be specified with SOURCE signatures");
+ return false;
+ }
+
+ if (uses_terminal) {
+ status.SetError("USES_TERMINAL may not be used with SOURCE signatures");
+ return false;
+ }
+
bool issueMessage = true;
std::ostringstream e;
MessageType messageType = MessageType::AUTHOR_WARNING;