summaryrefslogtreecommitdiff
path: root/Source/cmState.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-06-16 10:39:39 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2021-06-16 10:39:39 -0400
commitc017098d4d06ba114085ba7de47b99fc0b71e8d0 (patch)
treeeabd3fa444c96599d490b12ab49cbccda21866d3 /Source/cmState.cxx
parenta9ff600a509d6af1c25f482e1ce0184c97dd3f54 (diff)
downloadcmake-c017098d4d06ba114085ba7de47b99fc0b71e8d0.tar.gz
CMake: Allow override of unexpected non-flow-control commands
Fixes: #22310
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r--Source/cmState.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d97762bb6c..929b0fba96 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -480,7 +480,7 @@ void cmState::AddDisallowedCommand(std::string const& name,
void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
{
- this->AddFlowControlCommand(
+ this->AddBuiltinCommand(
name,
[name, error](std::vector<cmListFileArgument> const&,
cmExecutionStatus& status) -> bool {
@@ -495,6 +495,13 @@ void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
});
}
+void cmState::AddUnexpectedFlowControlCommand(std::string const& name,
+ const char* error)
+{
+ this->FlowControlCommands.insert(name);
+ this->AddUnexpectedCommand(name, error);
+}
+
bool cmState::AddScriptedCommand(std::string const& name, BT<Command> command,
cmMakefile& mf)
{