cmState: Add helper to represent removed commands

This commit is contained in:
Brad King
2024-11-26 14:41:48 -05:00
parent 59ba0948a3
commit 08e3393ac2
2 changed files with 13 additions and 0 deletions

View File

@@ -472,6 +472,18 @@ void cmState::AddDisallowedCommand(std::string const& name,
});
}
void cmState::AddRemovedCommand(std::string const& name,
std::string const& message)
{
this->AddBuiltinCommand(name,
[message](std::vector<cmListFileArgument> const&,
cmExecutionStatus& status) -> bool {
status.GetMakefile().IssueMessage(
MessageType::FATAL_ERROR, message);
return true;
});
}
void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
{
this->AddBuiltinCommand(

View File

@@ -183,6 +183,7 @@ public:
void AddDisallowedCommand(std::string const& name, BuiltinCommand command,
cmPolicies::PolicyID policy, const char* message,
const char* additionalWarning = nullptr);
void AddRemovedCommand(std::string const& name, std::string const& message);
void AddUnexpectedCommand(std::string const& name, const char* error);
void AddUnexpectedFlowControlCommand(std::string const& name,
const char* error);