Commit Graph

11 Commits

Author SHA1 Message Date
Sebastian Holtermann
a008578dee Autogen: Process files concurrently in AUTOMOC and AUTOUIC
This introduces concurrent thread processing in the `_autogen`
target wich processes AUTOMOC and AUTOUIC.
Source file parsing is distributed among the threads by
using a job queue from which the threads pull new parse jobs.
Each thread might start an independent ``moc`` or ``uic`` process.
Altogether this roughly speeds up the AUTOMOC and AUTOUIC build
process by the number of physical CPUs on the host system.

The exact number of threads to start in  the `_autogen` target
is controlled by the new AUTOGEN_PARALLEL target property which
is initialized by the new CMAKE_AUTOGEN_PARALLEL variable.
If AUTOGEN_PARALLEL is empty or unset (which is the default)
the thread count is set to the number of physical CPUs on
the host system.

The AUTOMOC/AUTOUIC generator and the AUTORCC generator are
refactored to use a libuv loop internally.

Closes #17422.
2018-01-17 17:23:49 +01:00
Sebastian Holtermann
3ce7eecedc Autogen: Fix for problematic nested lists separator
In the AutogenInfo.cmake file the separator for nested lists
was `@LSEP@` which led to a speed regression because the `@`
character triggered an (unsuccessful) expression evaluation.

By setting the policy version of the CMake instance in the
`_autogen` target to 3.9, the OLD `@` evaluating behavior
controlled by policy CMP0053 is disabled.

Also the nested lists separator string is changed to `<<<S>>>`,
which solves the problem twofold.

Closes #17570
2017-12-18 14:36:17 +01:00
Sebastian Holtermann
ab9d5896ae Autogen: Detect rcc feature once during configuration
We used to detect the `rcc` features before every `rcc` list invocation
wich resulted in `rcc` be called twice for every listing operation.

Now we detect the `rcc` list capabilities once during configuration and
pass it to the cmake_autorcc target in the info file.
2017-11-19 13:12:42 +01:00
Matthias Maennich
57132765e0 Replace cmArray{Begin,End,Size} by their standard counterparts
std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14
and an standard compliant implementation has been introduced within the
'cm' namespace: cm::{cbegin,cend}.

std::size is only part of C++17, hence exposing a compliant implementation
within namespace cm (cm::size).

where possible, the standard implementations are reused.
2017-10-23 17:51:35 +02:00
Sebastian Holtermann
f86ba8ee8e Autogen: Reintroduce per-config sources support
Reintroduce per-config sources support in AUTOGEN but disable it by default.
2017-09-25 16:27:38 +02:00
Sebastian Holtermann
5d3bca6485 Autogen: Rename cmQtAutoGen::GeneratorType to cmQtAutogen::Generator 2017-09-25 12:02:35 +02:00
Sebastian Holtermann
3f22374339 Autogen: Read relative paths from rcc output 2017-09-21 09:58:23 +02:00
Sebastian Holtermann
9468e926b0 Autogen: Refactor logging 2017-09-07 18:03:13 +02:00
Sebastian Holtermann
d8d064abbc Autogen: Use the same algorithm for RCC and UIC option merging 2017-09-07 17:53:19 +02:00
Sebastian Holtermann
37714f884b Autogen: Replace cmsys::SystemTools:: with cmSystemTools:: 2017-09-07 17:53:19 +02:00
Sebastian Holtermann
d1e5eb8497 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.
2017-09-07 17:53:18 +02:00