diff options
author | Pierre Testart <ptestart@soundhound.com> | 2022-11-23 17:11:06 (GMT) |
---|---|---|
committer | Pierre Testart <ptestart@soundhound.com> | 2022-11-28 16:40:11 (GMT) |
commit | f69d1872dbddb81f73d9f1dac98def9ee153ea9f (patch) | |
tree | e2804e5a2e7658c28c2549a9e630316a9f82fa4f /Source/cmGeneratorTarget.h | |
parent | b4e373aa9dd28f890e35a0dafc6a31994c8957c9 (diff) | |
download | CMake-f69d1872dbddb81f73d9f1dac98def9ee153ea9f.zip CMake-f69d1872dbddb81f73d9f1dac98def9ee153ea9f.tar.gz CMake-f69d1872dbddb81f73d9f1dac98def9ee153ea9f.tar.bz2 |
cmGeneratorTarget: Add caches to some functions
Add caches to the following cmGeneratorTarget functions in order to
improve performance:
- GetIncludeDirectories
- GetCompileOptions
- GetCompileDefinitions
- GetPrecompileHeaders
- GetLinkOptions
- GetLinkDirectories
Diffstat (limited to 'Source/cmGeneratorTarget.h')
-rw-r--r-- | Source/cmGeneratorTarget.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 25e6a81..b0036d0 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -489,6 +489,18 @@ public: std::string GetCreateRuleVariable(std::string const& lang, std::string const& config) const; +private: + using ConfigAndLanguage = std::pair<std::string, std::string>; + using ConfigAndLanguageToBTStrings = + std::map<ConfigAndLanguage, std::vector<BT<std::string>>>; + mutable ConfigAndLanguageToBTStrings IncludeDirectoriesCache; + mutable ConfigAndLanguageToBTStrings CompileOptionsCache; + mutable ConfigAndLanguageToBTStrings CompileDefinitionsCache; + mutable ConfigAndLanguageToBTStrings PrecompileHeadersCache; + mutable ConfigAndLanguageToBTStrings LinkOptionsCache; + mutable ConfigAndLanguageToBTStrings LinkDirectoriesCache; + +public: /** Get the include directories for this target. */ std::vector<BT<std::string>> GetIncludeDirectories( const std::string& config, const std::string& lang) const; |