diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-04-07 18:18:32 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-07-21 07:25:32 (GMT) |
commit | 015001aaf138119f4825e3c84c0845c5127f9088 (patch) | |
tree | 5f881f7df3823cad5d3ec7c603a5aac3f3a51c35 /Source/cmState.h | |
parent | 1eebc2956321c2e7da00a5d35e207bedb899c804 (diff) | |
download | CMake-015001aaf138119f4825e3c84c0845c5127f9088.zip CMake-015001aaf138119f4825e3c84c0845c5127f9088.tar.gz CMake-015001aaf138119f4825e3c84c0845c5127f9088.tar.bz2 |
cmState: Hold commands by value
Diffstat (limited to 'Source/cmState.h')
-rw-r--r-- | Source/cmState.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmState.h b/Source/cmState.h index 7e88030..ed70bd6 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <functional> #include <map> #include <memory> #include <set> @@ -27,6 +28,7 @@ class cmGlobVerificationManager; class cmPropertyDefinition; class cmStateSnapshot; class cmMessenger; +class cmExecutionStatus; class cmState { @@ -141,10 +143,13 @@ public: bool GetIsGeneratorMultiConfig() const; void SetIsGeneratorMultiConfig(bool b); + using Command = std::function<bool(std::vector<cmListFileArgument> const&, + cmExecutionStatus&)>; + // Returns a command from its name, case insensitive, or nullptr - cmCommand* GetCommand(std::string const& name) const; + Command GetCommand(std::string const& name) const; // Returns a command from its name, or nullptr - cmCommand* GetCommandByExactName(std::string const& name) const; + Command GetCommandByExactName(std::string const& name) const; void AddBuiltinCommand(std::string const& name, std::unique_ptr<cmCommand> command); @@ -212,8 +217,8 @@ private: std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions; std::vector<std::string> EnabledLanguages; - std::map<std::string, std::unique_ptr<cmCommand>> BuiltinCommands; - std::map<std::string, std::unique_ptr<cmCommand>> ScriptedCommands; + std::map<std::string, Command> BuiltinCommands; + std::map<std::string, Command> ScriptedCommands; cmPropertyMap GlobalProperties; std::unique_ptr<cmCacheManager> CacheManager; std::unique_ptr<cmGlobVerificationManager> GlobVerificationManager; |