Przeglądaj źródła

cmState: Add helper to represent removed commands

Brad King 1 rok temu
rodzic
commit
08e3393ac2
2 zmienionych plików z 13 dodań i 0 usunięć
  1. 12 0
      Source/cmState.cxx
  2. 1 0
      Source/cmState.h

+ 12 - 0
Source/cmState.cxx

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

+ 1 - 0
Source/cmState.h

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