mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-02 04:02:23 +03:00
Autogen: Add cmQtAutogenGlobalInitializer::Keywords class
The new `cmQtAutogenGlobalInitializer::Keywords` class instance is bound to the lifetime of the `cmQtAutogenGlobalInitializer` instance. Global static const strings would be allocated at program start and deallocated at program end. Keeping keyword strings alive only in the context where they're needed helps to reduce the memory footprint.
This commit is contained in:
1 parent
78eccc7836
commit
5431395d68
2 files changed
+22
No files matched your search
@@ -20,6 +20,13 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
cmQtAutoGenGlobalInitializer::Keywords::Keywords()
|
||||
: AUTOMOC("AUTOMOC")
|
||||
, AUTOUIC("AUTOUIC")
|
||||
, AUTORCC("AUTORCC")
|
||||
{
|
||||
}
|
||||
|
||||
cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
||||
std::vector<cmLocalGenerator*> const& localGenerators)
|
||||
{
|
||||
|
||||
@@ -17,11 +17,25 @@ class cmQtAutoGenInitializer;
|
||||
/// @brief Initializes the QtAutoGen generators
|
||||
class cmQtAutoGenGlobalInitializer
|
||||
{
|
||||
public:
|
||||
/// @brief Collection of QtAutogen related keywords
|
||||
class Keywords
|
||||
{
|
||||
public:
|
||||
Keywords();
|
||||
|
||||
std::string AUTOMOC;
|
||||
std::string AUTOUIC;
|
||||
std::string AUTORCC;
|
||||
};
|
||||
|
||||
public:
|
||||
cmQtAutoGenGlobalInitializer(
|
||||
std::vector<cmLocalGenerator*> const& localGenerators);
|
||||
~cmQtAutoGenGlobalInitializer();
|
||||
|
||||
Keywords const* kw() const { return Keywords_.get(); };
|
||||
|
||||
bool generate();
|
||||
|
||||
private:
|
||||
@@ -48,6 +62,7 @@ private:
|
||||
std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
|
||||
std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
|
||||
std::unordered_map<std::string, std::string> ExecutableTestOutputs_;
|
||||
std::unique_ptr<Keywords> Keywords_;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user