cmAddCustomCommandCommand: Move SOURCE signature error messages

Helps readability of the code. All the SOURCE signature code is
in the else statement.
This commit is contained in:
Juan Ramos
2024-05-15 13:58:47 -07:00
parent 96028ad95c
commit f9028379f7

View File

@@ -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;