CMP0050: Remove support for OLD behavior

This commit is contained in:
Brad King
2024-12-05 15:22:38 -05:00
parent 9f6011e307
commit 6973f8304e
29 changed files with 18 additions and 226 deletions

View File

@@ -5,7 +5,6 @@
#include <algorithm>
#include <iterator>
#include <set>
#include <sstream>
#include <unordered_set>
#include <utility>
@@ -590,44 +589,10 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
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;
}
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;
switch (mf.GetPolicyStatus(cmPolicies::CMP0050)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0050) << "\n";
break;
case cmPolicies::OLD:
issueMessage = false;
break;
case cmPolicies::NEW:
messageType = MessageType::FATAL_ERROR;
break;
}
if (issueMessage) {
e << "The SOURCE signatures of add_custom_command are no longer "
"supported.";
mf.IssueMessage(messageType, e.str());
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
// Use the old-style mode for backward compatibility.
mf.AddCustomCommandOldStyle(target, outputs, depends, source, commandLines,
comment);
mf.IssueMessage(
MessageType::FATAL_ERROR,
"The SOURCE signatures of add_custom_command are no longer supported.");
return false;
}
return true;