Commit Graph

23465 Commits

Author SHA1 Message Date
Brad King
4609aaf513 Merge topic 'perf-source-lookup'
3b95ab56 Performance: Improve efficiency of source file lookup in cmMakefile
e0188803 cmMakefile: Drop unused method
fe1e811b cmSourceFileLocation: Drop unnecessary copy-assignment operator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1154
2017-09-22 10:17:49 -04:00
Brad King
7df7eea7cf Merge topic 'autogen-generators-refactor'
51fd7b71 Autogen: Tests: Add a change-not test to the mocRerun test
c8f92db7 Autogen: Tests: Disable an AUTOMOC_DEPENDS_FILTER test for Ninja
3c77515e Autogen: Tests: Refactor the QtAutogenRebuild rccDepends test
04a0daee Autogen: Tests: Move each rerun test script to a NAME.cmake file
e5c6610a Autogen: Tests: Extend CMAKE_AUTOMOC_DEPEND_FILTERS rebuild test
93265652 Autogen: Tests: Add <SUBDIR>/ui_view.h AUTOUIC includes to sameName test
4eb7d817 Autogen: Tests: Add <SUBDIR>/item.moc includes to sameName test
3f223743 Autogen: Read relative paths from rcc output
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1244
2017-09-22 10:15:54 -04:00
Brad King
a6f2ea6ada Merge topic 'variable_watch-modify-on-callback'
4c0edbd7 variable_watch: Made it safe to add/remove watches in access callbacks
28d2c6ef test: Added additional unit test to variable_watch

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1284
2017-09-22 10:12:48 -04:00
Brad King
00389afa34 Merge topic 'string-empty'
37d9387b Replace empty-string comparisons with checking against `empty()`.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1275
2017-09-22 10:11:23 -04:00
Kitware Robot
583d8e55ac CMake Nightly Date Stamp 2017-09-22 00:01:04 -04:00
Justin Berger
4c0edbd725 variable_watch: Made it safe to add/remove watches in access callbacks 2017-09-21 11:50:57 -04:00
Brad King
46f7a6707b Merge topic 'update-kwsys'
ff0ddff7 Merge branch 'upstream-KWSys' into update-kwsys
d49b95b8 KWSys 2017-09-21 (ff912e4d)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1297
2017-09-21 08:30:55 -04:00
Brad King
5737bb3756 Merge topic 'cpack-different-checksum-file-per-generator'
b06870e5 CPack: use a distinct checksum file for each generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1291
2017-09-21 08:19:52 -04:00
Brad King
5c5b28dd9d Merge topic 'cpack-check-install-script'
09166339 CPack: Add missing check for CPACK_INSTALL_SCRIPT variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1090
2017-09-21 08:19:11 -04:00
Brad King
ff0ddff785 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2017-09-21 (ff912e4d)
2017-09-21 07:17:36 -04:00
Pavel Solodovnikov
37d9387be3 Replace empty-string comparisons with checking against empty(). 2017-09-21 11:23:19 +03:00
Sebastian Holtermann
3f22374339 Autogen: Read relative paths from rcc output 2017-09-21 09:58:23 +02:00
Kitware Robot
1cf9437517 CMake Nightly Date Stamp 2017-09-21 00:01:03 -04:00
Sebastian Holtermann
8bee55bce1 Autogen: In VERBOSE mode print why files are (re)generated 2017-09-20 23:21:01 +02:00
Sebastian Holtermann
15346bec19 Autogen: Refactor cmQtAutoGenerators
The refactoring of cmQtAutoGenerators serializes the program flow and
makes it less jumpy in terms of function calling.
Instead of keeping and passing multiple std::vectors and std::maps in
function arguments, single lists with job descriptions are used,
one job list for MOC, UIC, RCC respectively.
Several utility functions and methods were replaced with scoped lambdas
and the remaining methods were sorted by their scope (MOC, UIC, RCC).

Error and warning messages were refactored to be more verbose
about the problem at hand.

The source parsing algorithms were rewritten in large parts.
In the process a lack of functionality of CMAKE_AUTOMOC_DEPEND_FILTERS
was discovered and fixed. CMAKE_AUTOMOC_DEPEND_FILTERS did not extract
dependency file names from headers that were not in the target sources
but were registered to AUTOMOC by a `#include "moc_<NAME>.cpp"` statement.
A test for this use case is provided in a follow up commit.
2017-09-20 23:21:01 +02:00
Aaron Orenstein
3b95ab5693 Performance: Improve efficiency of source file lookup in cmMakefile
Add an unordered map to cmMakefile to speed up GetSource() lookups.
2017-09-20 14:10:47 -04:00
Aaron Orenstein
e018880350 cmMakefile: Drop unused method 2017-09-20 14:10:45 -04:00
Aaron Orenstein
fe1e811b4f cmSourceFileLocation: Drop unnecessary copy-assignment operator
Update the one place that used it to avoid needing assignment.
2017-09-20 14:10:44 -04:00
Domen Vrankar
b06870e5ff CPack: use a distinct checksum file for each generator
Different CPack generators could produce checksum files with the same
name which were overwritten by each other since only package name
without extensions was used for checksum file name generation.  This
patch adds package extension to checksum files to prevent collisions.

Fixes: #16840
2017-09-20 14:01:23 -04:00
Alex Turbov
091663395e CPack: Add missing check for CPACK_INSTALL_SCRIPT variable
Also add a test case that uses CPACK_INSTALL_SCRIPT.

Co-Author: Domen Vrankar <domen.vrankar@gmail.com>
Fixes: #15005
2017-09-20 13:33:22 -04:00
Brad King
95df03a1d4 Merge topic 'CTest-cov-string'
062776e7 CTest: pass std::string to cmCTestCoverageHandler::ShouldIDoCoverage()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1290
2017-09-20 13:21:58 -04:00
Brad King
1490466bf9 Merge topic 'ninja-performance'
7374cb85 Ninja: Cache ConvertToNinjaPath results to avoid repeat work
ed19e813 Ninja: Improve performance with deeply-dependent custom targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1217
2017-09-20 13:20:46 -04:00
Brad King
be475daa8f Merge topic 'tidy-modernize-loop-convert'
706b37b7 Enable clang-tidy modernize-loop-convert lint

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1287
2017-09-20 13:18:28 -04:00
Brad King
cb36e91eff Merge topic 'cxx11-nullptr'
a5279ae5 Use C++11 nullptr (cont.)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1283
2017-09-20 13:17:25 -04:00
Brad King
c8826fe04f Merge topic 'cxx-checks-tolerate-unused-flag'
71b65abc C++ feature checks: Filter out warnings caused by user flags
eb3abf8b C++ feature checks: Prepare for multiple check output filters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1286
2017-09-20 13:16:11 -04:00
Brad King
4f971e700a Merge topic 'CTest-crash-missing-glob'
6db63012 CTest: fix crash if source file for coverage cannot be found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1289
2017-09-20 07:46:09 -04:00
Kitware Robot
33ead73d73 CMake Nightly Date Stamp 2017-09-20 00:01:05 -04:00
Matthias Maennich
a5279ae553 Use C++11 nullptr (cont.)
Fix remaining occurrences of the issue addressed in commit 5962db4389
(Use C++11 nullptr, 2017-08-22) that are only showing up on macOS.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-19 11:44:21 -04:00
Rolf Eike Beer
062776e75b CTest: pass std::string to cmCTestCoverageHandler::ShouldIDoCoverage()
Avoid needless conversion back and forth.
2017-09-19 17:41:41 +02:00
Rolf Eike Beer
6db6301205 CTest: fix crash if source file for coverage cannot be found
The opened XML elements were not closed, so an assert was triggered when the
file was finally closed. If CMake is built with assertions disabled then an
invalid XML file will be produced.
2017-09-19 17:37:29 +02:00
Matthias Maennich
7374cb857c Ninja: Cache ConvertToNinjaPath results to avoid repeat work
Calls to this method may dominate generation time in some cases.
Measurements for configuring cmake itself show a cache hit rate of ~57%
(7753 total calls, 4453 cache hits).  For a larger project (that also
makes use of custom targets as prerequisite for all compile targets),
the measured cache hit ratio is ~96% (2530827 total calls, 2433124 cache
hits).  For this project the observable cmake runtime could be reduced
from 40s to 30s.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-19 11:21:36 -04:00
Matthias Maennich
ed19e8136d Ninja: Improve performance with deeply-dependent custom targets
The commit v3.7.0-rc1~339^2 (Ninja: Fix inter-target order-only
dependencies of custom command, 2016-07-20) might cause performance
degradations for larger projects.  Especially when using custom
commands as an input for each compilation rule (e.g. generated headers).

For reference in the following I am referring to
  Source/cmGlobalNinjaGenerator.cxx:
    -> cmGlobalNinjaGenerator::AppendTargetDependsClosure
    -> cmGlobalNinjaGenerator::ComputeTargetDependsClosure

It turned out that the mentioned commit is doing (indirectly) some
redundant work that might impact performance when generating large
projects.

Imagine the dependency tree of custom targets:

    A
     \
      C - D - E
     /
    B

For each target the transitive closure is calculated recursively, but as
the TargetDependsClosures are only cached on the top most level, everything
downstream has to be recalculated. I.e.

    A->C->D->E
    B->C->D->E

This ultimately leads to a lot of redundant calls to AppendTargetOutputs.
The recursive nature of the algorithm itself is not significant to the
problem, but reducing the work to actually to be done work, eliminates the
performance problem.

This patch changes the way, intermediate results are cached. Rather than
caching the closure of targets, we cache the closure of outputs. Such that
in the example above at B->C the cache already would kick in.

Caching the outputs has one disadvantage that the patch takes care of.
In case of such a structure

    A       E
     \     / \
      C - D   G
     /     \ /
    B       F

the calling order for A would be

    A->C->D->E->G  (at which time G is seen to the recursion)

then the recursion returns until it reaches

    A->C->D->F     (at which the seen G would prevent to recurse down to G)

But this would poison the cache for F with a wrong value (without G).
Hence we use a local result set to ensure the cache is still consistently
populated.

For a large C++ project with around 25k targets this reduced the CMake
configure / generate time from ~40s to ~29s.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-19 11:19:34 -04:00
Brad King
706b37b7f5 Enable clang-tidy modernize-loop-convert lint
Fix remaining diagnostics by this lint and remove it from our list of
disabled lints.
2017-09-19 09:32:25 -04:00
Brad King
71b65abca2 C++ feature checks: Filter out warnings caused by user flags
Filter out `-Winvalid-command-line-argument` warnings from Clang (that
can be caused by user-specified flags) so that they do not break our
checks for C++ feature availability.
2017-09-19 09:25:30 -04:00
Brad King
eb3abf8b2b C++ feature checks: Prepare for multiple check output filters 2017-09-19 09:22:54 -04:00
Brad King
4547d9a830 Merge topic 'ranged-for'
f43baf69 Meta: modernize old-fashioned loops to range-based `for` (CPack).

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1274
2017-09-19 09:07:48 -04:00
Brad King
7c28081c14 Merge topic 'string-clear'
5db3aac1 Meta: replace empty-string assignments with `clear()`.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1276
2017-09-19 08:27:00 -04:00
Brad King
8fee054eca Merge topic 'vs-manifestuac-flag-map'
3232f84c VS: Fix MANIFESTUAC link flag map to .vcxproj elements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !526
2017-09-19 08:25:22 -04:00
Pavel Solodovnikov
f43baf6981 Meta: modernize old-fashioned loops to range-based for (CPack).
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
2017-09-19 08:06:08 -04:00
Kitware Robot
2bfb434e84 CMake Nightly Date Stamp 2017-09-19 00:01:05 -04:00
comicfans
3232f84c19 VS: Fix MANIFESTUAC link flag map to .vcxproj elements
Add special parsing of the flags given in `/MANIFESTUAC:"..."` in order
to map them correctly to `.vcxproj` elements.

Keep the old incorrect flag table entries for `uiAccess` and `level`
flags for compatibility even though they do not really exist.

Fixes: #16563
2017-09-18 11:53:22 -04:00
Brad King
a1cdf537ff Merge topic 'ctest-runcommand'
67529aab Doc: document that CoverageExtraFlags will come first
69fac3c3 pass arguments as vector to cmCTest::RunCommand()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1261
2017-09-18 10:16:08 -04:00
Brad King
836f42b3c0 Merge topic 'cmake-gui-high-dpi'
6fb36572 cmake-gui: Enable High DPI scaling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1271
2017-09-18 10:08:59 -04:00
Brad King
dd77a2ed4d Merge topic 'libuv-bootstrap'
714ce728 bootstrap: Make libuv available during bootstrap
6a2d967d bootstrap: Require compiler mode aware of C99 on Solaris

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1131
2017-09-18 10:08:07 -04:00
Brad King
ce4f635409 Merge topic 'cxx11-override'
98530d3c cm_codecvt: Tell IWYU to keep cmConfigure.h
4e14498f Drop now-unused definition of CM_OVERRIDE
0b33aee4 Use C++11 override instead of CM_OVERRIDE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1265
2017-09-18 10:06:47 -04:00
Kitware Robot
14ffd3b7e9 CMake Nightly Date Stamp 2017-09-18 00:01:03 -04:00
Brad King
714ce72882 bootstrap: Make libuv available during bootstrap
On UNIX, build only the parts of libuv we need for the filesystem,
process, and poll abstractions using the POSIX poll() backend.  This
avoids many platform-specific conditions.  On Windows, build all of
libuv; there are no conditional alternatives anyway.
2017-09-17 11:10:18 -04:00
Kitware Robot
214d0ce170 CMake Nightly Date Stamp 2017-09-17 00:01:03 -04:00
Kitware Robot
db86cf4e7e CMake Nightly Date Stamp 2017-09-16 00:01:03 -04:00
Pavel Solodovnikov
5db3aac111 Meta: replace empty-string assignments with clear(). 2017-09-16 02:26:49 +03:00