cmState: Prohibit override of flow control commands

This commit is contained in:
Kyle Edwards
2020-10-22 16:50:42 -04:00
parent 3a82ff6a11
commit 8aee7fdb32
23 changed files with 108 additions and 21 deletions
+7 -1
View File
@@ -9,6 +9,7 @@
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "cmDefinitions.h"
@@ -24,6 +25,7 @@
class cmCacheManager;
class cmCommand;
class cmGlobVerificationManager;
class cmMakefile;
class cmStateSnapshot;
class cmMessenger;
class cmExecutionStatus;
@@ -157,10 +159,13 @@ public:
std::unique_ptr<cmCommand> command);
void AddBuiltinCommand(std::string const& name, Command command);
void AddBuiltinCommand(std::string const& name, BuiltinCommand command);
void AddFlowControlCommand(std::string const& name, Command command);
void AddFlowControlCommand(std::string const& name, BuiltinCommand command);
void AddDisallowedCommand(std::string const& name, BuiltinCommand command,
cmPolicies::PolicyID policy, const char* message);
void AddUnexpectedCommand(std::string const& name, const char* error);
void AddScriptedCommand(std::string const& name, Command command);
bool AddScriptedCommand(std::string const& name, BT<Command> command,
cmMakefile& mf);
void RemoveBuiltinCommand(std::string const& name);
void RemoveUserDefinedCommands();
std::vector<std::string> GetCommandNames() const;
@@ -223,6 +228,7 @@ private:
std::vector<std::string> EnabledLanguages;
std::unordered_map<std::string, Command> BuiltinCommands;
std::unordered_map<std::string, Command> ScriptedCommands;
std::unordered_set<std::string> FlowControlCommands;
cmPropertyMap GlobalProperties;
std::unique_ptr<cmCacheManager> CacheManager;
std::unique_ptr<cmGlobVerificationManager> GlobVerificationManager;