diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-08-26 11:59:57 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-09-07 15:53:18 (GMT) |
commit | d1e5eb849704f73d646f64105d44807f3de50e48 (patch) | |
tree | 2246c9fd4e76d5f6eecdf42372d7c28adfc19b0a /Source/cmQtAutoGenDigest.h | |
parent | 25ac91a715ee5f21fd169c47d55e02234c00915f (diff) | |
download | CMake-d1e5eb849704f73d646f64105d44807f3de50e48.zip CMake-d1e5eb849704f73d646f64105d44807f3de50e48.tar.gz CMake-d1e5eb849704f73d646f64105d44807f3de50e48.tar.bz2 |
Autogen: Iterate source files only once
This is a large commit that serves multiple purposes
- Iterate source files only once and store all extracted
information in a cmQtAutogenDigest class that can be reused.
This is brings speed improvements because several properties
are only evaluated once. More that that it helps to avoid
duplication of code with non trivial files property checks.
- Fix the Visual Studio generator to use PRE_BUILD when possible.
- Convert `for( ... )` loops to C++11 range base loops where possible
(cmQtAutogen*.cxx only).
- String concatenation optimizations.
Diffstat (limited to 'Source/cmQtAutoGenDigest.h')
-rw-r--r-- | Source/cmQtAutoGenDigest.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenDigest.h b/Source/cmQtAutoGenDigest.h new file mode 100644 index 0000000..2bd9f04 --- /dev/null +++ b/Source/cmQtAutoGenDigest.h @@ -0,0 +1,62 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmQtAutoGenDigest_h +#define cmQtAutoGenDigest_h + +#include "cmConfigure.h" // IWYU pragma: keep + +#include <memory> +#include <string> +#include <vector> + +class cmGeneratorTarget; + +class cmQtAutoGenDigestQrc +{ +public: + cmQtAutoGenDigestQrc() + : Generated(false) + { + } + +public: + std::string QrcFile; + std::string RccFile; + bool Generated; + std::vector<std::string> Options; + std::vector<std::string> Resources; +}; + +/** \class cmQtAutoGenDigest + * \brief Filtered set of QtAutogen variables for a specific target + */ +class cmQtAutoGenDigest +{ +public: + cmQtAutoGenDigest(cmGeneratorTarget* target) + : Target(target) + , MocEnabled(false) + , UicEnabled(false) + , RccEnabled(false) + { + } + +public: + cmGeneratorTarget* Target; + std::string QtVersionMajor; + std::string QtVersionMinor; + bool MocEnabled; + bool UicEnabled; + bool RccEnabled; + std::vector<std::string> Headers; + std::vector<std::string> HeadersGenerated; + std::vector<std::string> Sources; + std::vector<std::string> SourcesGenerated; + std::vector<cmQtAutoGenDigestQrc> Qrcs; +}; + +// Utility types +typedef std::unique_ptr<cmQtAutoGenDigest> cmQtAutoGenDigestUP; +typedef std::vector<cmQtAutoGenDigestUP> cmQtAutoGenDigestUPV; + +#endif |