summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoMocUic.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Source: Convince NVHPC that RAII variables are usedBrad King2021-04-281-0/+6
|
* Merge topic 'depfile-reader-thread-safety'Brad King2021-04-161-5/+6
|\ | | | | | | | | | | | | 53d523f2e1 autogen: fix race in depfile parsing Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6008
| * autogen: fix race in depfile parsingKyle Edwards2021-04-151-5/+6
| | | | | | | | | | | | | | | | cmReadGccDepfile() calls cmSystemTools::CollapseFullPath(), which is not thread safe due to internal caching. Serialize calls to cmReadGccDepfile() in autogen to avoid thread safety issues. Fixes: #22014
* | Merge topic 'ninja-automoc-cycle'Brad King2021-03-301-0/+7
|\ \ | |/ | | | | | | | | | | | | | | | | ca7c76269b Tests: Add test for Ninja automoc dependency cyle 54ad3e4958 autogen: Don't include SKIP_AUTOMOC files in depfile Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Jörg Bornemann <joerg.bornemann@qt.io> Acked-by: Craig Scott <craig.scott@crascit.com> Merge-request: !5956
| * autogen: Don't include SKIP_AUTOMOC files in depfileKyle Edwards2021-03-291-0/+7
| | | | | | | | | | | | | | SKIP_AUTOMOC files should not be included in moc processing, which means they shouldn't be included in the depfile either. Remove them. Fixes: #21977
* | Merge topic 'per-config-autogen-info-file'Brad King2021-02-231-2/+2
|\ \ | |/ | | | | | | | | | | a3df25c694 Autogen: Don't change the order of HEADERS array in AutogenInfo.json Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5840
| * Autogen: Don't change the order of HEADERS array in AutogenInfo.jsonCraig Scott2021-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | Qt6 reads our internal AutogenInfo.json file. In 92d7b456e5 (Autogen: Add support for per-config sources, 2020-10-20), the ordering of the HEADERS array elements was changed and this broke their cmake_automoc_parser. We don't need to change the order of the array elements, we can append to the existing ones instead. Do this to allow their cmake_automoc_parser to continue to work. Fixes: #21823
* | AUTOUIC: Fix missed ui files in Ninja depsAlexey Edelev2021-02-151-3/+3
|/ | | | | | | This fixes the issue when two .ui files have the same name, but different locations. In this case, Ninja deps file only contains .ui file that was found first. So <src>/xxx/yyy.ui and <src>/yyy.ui were processed as a same file by AUTOUIC.
* clang-tidy: fix `readability-use-anyofallof` warningsBen Boeckel2021-01-271-32/+30
|
* clang-tidy: fix `readability-redundant-access-specifiers` warningsBen Boeckel2021-01-271-6/+0
|
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-1/+1
|
* AutoMoc: Re-run after adding Q_OBJECT macroJoerg Bornemann2021-01-061-1/+25
| | | | | | | | | | | | | | | | Consider a Qt project with a header file that does not contain the Q_OBJECT macro. Adding the Q_OBJECT macro is supposed to trigger a run of moc. When using Qt >= 5.15 and the Ninja generator, re-running AutoMoc is controlled by the contents of a Ninja depfile. In the situation above, AutoMoc would not re-run, because the header/source files without Q_OBJECT macro are not contained in the depfile. Add the relevant source files of the project to the merged depfile to re-run AutoMoc whenever a source file changes. Fixes: #21620
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-560/+619
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Autogen: Add support for per-config sourcesBrad King2020-12-161-4/+42
| | | | Fixes: #20682
* cmGccDepfileReader: Rework helper codeKyle Edwards2020-10-131-4/+4
| | | | | Fix some of the semantics of the depfile, add error handling, and refactor cmGccDepfileLexerHelper.
* AutoMoc: Re-run moc if a dependency is missingJoerg Bornemann2020-09-091-7/+15
| | | | | | | | | | | | | | | | | | | | | AutoMoc uses the moc-emitted dependency file of Qt 5.15 to track dependencies. Such a dependency may well live outside the project and can vanish, for example when installing a new compiler version. This situation was detected before, but merely a warning was issued. Now, we're considering a generated file as out of date if a dependency is missing and re-generate it. We also have to remove the missing dependency from the ParseCache. Otherwise the AUTOMOC target for all generators other than Ninja will always be out of date. The ParseCacheChanged flag had to be made atomic, because we're potentially accessing it from multiple threads. The dependencies vector itself is not vulnerable in this regard, because there's one vector per file, and we're accessing exactly one ParseCacheT::FileHandleT per thread. Fixes: #21136
* Merge branch 'backport-3.17-automoc-depend-project-file'Brad King2020-08-311-1/+3
|\
| * AutoMoc: Restore support for re-running after project file changesJoerg Bornemann2020-08-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Qt >= 5.15.0 and Ninja generators AutoMoc creates a depfile to let Ninja decide when to run AutoMoc. This was introduced by commit aebfbcaa46 (AutoGen: Use depfiles for the XXX_autogen ninja targets, 2020-01-14, v3.17.0-rc1~58^2). However, AutoMoc was not triggered after adding a new moc-able file to the project. This patch adds the project file (and potentially included files) to the dependencies in the depfile. Now, a re-run of AutoMoc is triggered if the project file changes. Fixes: #21127
* | Merge branch 'backport-3.17-automoc_timestamp_deps'Brad King2020-08-051-1/+3
|\ \ | |/
| * AutoGen: Fix over-specified direct dependencies of custom commandAlexandru Croitor2020-08-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AutoMoc timestamp creating custom command explicitly depended on all dependencies of the origin target (associated to the AutoGen target). When an origin target depended on a shared library 'libfoo.so', if it was re-linked, the AutoMoc custom command would touch its output timestamp file, and thus cause needless rebuilding of sources, despite the shared library not having any influence on the AutoMoc generated files. Introduce a new '<target>_autogen_timestamp_deps' utility target, which will serve as an 'order-only' dependency for the custom command. This will prevent needless rebuilding, because touching 'libfoo.so' will not cause the custom command to be re-executed. The new AutoMoc dependency tree looks like: '_autogen_timestamp_deps (serves as order-only dep)' <- '<target_autogen>/timestamp' file ( + moc deps file) <- '<target>_autogen' target. Fixes: #21020
* | Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-2/+2
| | | | | | | | Fixes: #20666
* | Refactor: Avoid `std::endl` where it's not necessary (part 2)Alex Turbov2020-03-241-12/+11
|/ | | | | | | | | | | | The `std::endl` manipulator, except inserting `\n` character, also performs `os.flush()`, which may lead to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning. * replace multiple `operator<<` calls on a string literal w/ the only call and the only (bigger) string literal; * replace one character string literal used in `operator<<` w/ a char literal.
* AutoGen: Use depfiles for the XXX_autogen ninja targetsJoerg Bornemann2020-01-281-0/+116
| | | | | | | | | | | | | | | The XXX_autogen targets are implemented as utility commands, which means they always run, even if there weren't any changes. For the Ninja generator and Qt >= 5.15 we're taking a different approach: This commit adds custom commands that create XXX_autogen/timestamp files. Those custom commands have a depfile assigned that is generated from the depfiles that were created by moc. The XXX_autogen targets merely wrap the XXX_autogen/timestamp custom commands. Fixes: #18749
* AutoGen: Use moc's feature to output dependenciesJoerg Bornemann2020-01-281-14/+78
| | | | | | | | | | | | | | | In Qt version 5.15.0 moc learned to output the dependencies of the generated file. This commit enhances JobCompileMocT to read the dependency file written by moc. The dependencies are stored in the same cache that's used for the dependencies determined by dependency filters. The dependency filter functionality is turned off if moc's dependency output feature is used. Fixes: #17750 Fixes: #19058
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-7/+7
|
* Autogen: Fix ambiguity in header file detection on WindowsSebastian Holtermann2019-10-301-5/+3
| | | | | | | | | On Windows, `CollapseFullPath` called with a path that ends with a dot might return a file with the same base name but any extension. To make sure we get only the file with the requested header extension, pass the complete file name to `CollapseFullPath`. Fixes: #19892
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-16/+18
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* Autogen: Make cmQtAutoMocUic a free functionSebastian Holtermann2019-09-281-101/+629
|
* Autogen: Refactor json info file reading interfaceSebastian Holtermann2019-09-281-65/+63
|
* Autogen: Use JSON instead of CMake script for info filesSebastian Holtermann2019-09-251-269/+244
| | | | | | | | | | | | | | | | | | | | | | | We used to store information for the _autogen target in a CMake script file AutogenInfo.cmake, which was imported by a temporary cmake instance in the _autogen target. This introduced the overhead of creating a temporary cmake instance and inherited the limitations of the CMake language which only supports lists. This patch introduces JSON files to pass information to AUTORCC and autogen_ targets. JSON files are more flexible for passing data, e.g. they support nested lists. The patch has the side effects that - AutogenInfo.cmake is renamed to AutogenInfo.json - AutogenOldSettings.txt is renamed to AutogenUsed.txt - RCC<qrcBaseName><checksum>Info.cmake is renamed to AutoRcc_<qrcBaseName>_<checksum>_Info.json - RCC<qrcBaseName><checksum>.lock is renamed to AutoRcc_<qrcBaseName>_<checksum>_Lock.lock - RCC<qrcBaseName><checksum>Settings.txt is renamed to AutoRcc_<qrcBaseName>_<checksum>_Used.txt
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-4/+6
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* Autogen: Add moc path prefix generation (AUTOMOC_PATH_PREFIX)Sebastian Holtermann2019-09-161-34/+76
| | | | | | | | | | | | | | | | The new `AUTOMOC_PATH_PREFIX` boolean target property enables automatic generation of the path prefix `-p` option for `moc`. `AUTOMOC_PATH_PREFIX` is initialized from the variable `CMAKE_AUTOMOC_PATH_PREFIX`, which is ON by default. When `AUTOMOC_PATH_PREFIX` is enabled, CMake tests if a `moc`ed header file is in one of the include directories. If so, then the `-p` option, with the relative path of the header parent directory to the respective include directory, is added to the `moc` command. If the header file is not in an include directory, the `-p` option is omitted. Closes: #18815 "AUTOMOC: generated files include full relative path, breaking certain reproducible builds"
* Autogen: Add IsHeader flag to SourceFileT classSebastian Holtermann2019-09-161-72/+81
|
* Autogen: Abbreviate file paths in messagesSebastian Holtermann2019-09-161-132/+148
| | | | | | | | | | | This introduces the `cmQtAutoGenerator::MessagePath` method, that abbreviates paths by placing a - "SRC:" prefix in place of the project source directory - "BIN:" prefix in place of the project binary directory The method is used in `AUTO{MOC,UIC,RCC}` when paths are displayed in messages. This makes the messages generated by `AUTO{MOC,UIC,RCC}` shorter and improves their readability.
* Autogen: Split JobEvalCacheT job into separate moc and uic jobsSebastian Holtermann2019-09-161-234/+274
| | | | | | | | | This splits the `JobEvalCacheT` job into separate `JobEvalCacheMocT` and `JobEvalCacheUicT` classes, that run concurrently. The `JobEvalCache*T::FindIncluded*` methods are overhauled to store probed directoriy names only if probing fails. Warning messages are refactored to show the file name and the probed directories instead of all probed file paths. This is easier to read.
* Autogen: Split JobProbeDepsT job into separate moc and uic jobsSebastian Holtermann2019-09-161-57/+83
| | | | | | | | | | | | | By splitting `JobProbeDepsT` into two independent `JobProbeDepsMocT`, `JobProbeDepsUicT`, the moc and uic job generation will happen concurrently. This should improve the execution speed, when both AUTOMOC and AUTOUIC are enabled. Parent directory names for moc and uic output files are are collected in a `std::unordered_set<std::string>` and get created in a batch. Beforehand we tried to create the parent directory for each output file. This led to duplications of `MakeDirectory` calls when there were multiple output files in the same directory (which is the case usually).
* Autogen: Rename job classesSebastian Holtermann2019-09-161-27/+27
|
* Autogen: Remove CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE sort duplicationSebastian Holtermann2019-09-161-40/+4
| | | | | | | This removes code that sorts include directories for `AUTOMOC` according to `CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE`. This is possible because the included directories passed to `AUTOMOC` are already sorted, also with respect to `CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE`.
* Autogen: Use CollapseFullPath instead of RealPath to support symbolic linksSebastian Holtermann2019-09-161-4/+6
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-1/+1
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-041-1/+1
| | | | | | | | Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places.
* Merge topic 'autogen_strcat'Brad King2019-08-291-273/+226
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 32b15d320f Autogen: cmQtAutoMocUic settings hash computation optimizations b66cd3fe63 Autogen: cmQtAutoMocUic string concatenation cleanups 619a92eacd Autogen: cmQtAutoRcc settings hash computation optimizations 10dc684508 Autogen: cmQtAutoRcc string concatenation cleanups da6c4b1273 Autogen: cmQtAutoGenInitializer string concatenation cleanups 7a78d15415 Autogen: Let cmQtAutoGenerator::Logger methods accept cm::string_view c797148e85 Autogen: Use cm::string_view for AUTO{MOC,UIC,RCC} generator names 8586077baa Autogen: Modernize cmQtAutoGen methods using cm::string_view Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3742
| * Autogen: cmQtAutoMocUic settings hash computation optimizationsSebastian Holtermann2019-08-271-15/+9
| |
| * Autogen: cmQtAutoMocUic string concatenation cleanupsSebastian Holtermann2019-08-271-258/+217
| |
* | Merge topic 'autogen_fix_use_after_move'Brad King2019-08-281-2/+2
|\ \ | |/ |/| | | | | | | | | e32f70036c Autogen: Fix AUTOUIC segfault, when file includes colliding ui_*.h file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3745
| * Autogen: Fix AUTOUIC segfault, when file includes colliding ui_*.h fileSebastian Holtermann2019-08-271-2/+2
| | | | | | | | | | | | | | This fixes a case of use after move of a `std::shared_ptr` in `AUTOUIC`. It triggered a segfault, when the error message for colliding `ui_*.h` includes in different files was computed.
* | Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* | Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-72/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* | clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-2/+4
| |
* | Merge topic 'cmExpandList'Kyle Edwards2019-08-161-4/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 2f6495e24e cmSystemTools: Remove ExpandListArgument methods f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument ff42dec891 cmStringAlgorithms: Add cmExpandList functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3682