Commit Graph

37335 Commits

Author SHA1 Message Date
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
08512646e1 Merge topic 'fix-compiler-failure-formatting'
f23def2c Improve formatting of compiler failure error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1285
2017-09-20 13:16:52 -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
821b54f4a6 Merge branch 'release-3.9' 2017-09-20 08:53:50 -04:00
Brad King
7486607c87 CMake 3.9.3 2017-09-20 07:53:03 -04:00
Brad King
28cbfe1519 Merge branch 'release-3.9' 2017-09-20 07:50: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
Brad King
8dae0ab6d1 Merge branch 'CTest-crash-missing-glob' into release-3.9
Merge-request: !1289
2017-09-19 11:50:20 -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
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
f23def2cf3 Improve formatting of compiler failure error message
When we report that a compiler was unable to build a simple test
program, indent the output of the attempt so that our message formatting
will show it as a pre-formatted block.
2017-09-19 09:14:40 -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
Brad King
71c752a63b Merge topic 'gtest-fix-windows-linking'
e2cca9f8 FindGTest: Avoid macro name collision
4636c64b FindGTest: Improve test to catch link error
35061791 FindGTest: Fix shared linking on Windows
9fd9e448 FindGTest: Avoid using find_dependency in a find module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1267
2017-09-19 08:24:25 -04:00
Brad King
d947310f17 Merge topic 'FindBoost-IN_LIST'
a929dd16 FindBoost: Simplify search in lists

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1281
2017-09-19 08:15:36 -04:00
Brad King
3be6835ed1 Merge topic 'target_system_docs'
77eb212d Help: Clarify/make consistent the APPLE, UNIX and WIN32 variable docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1279
2017-09-19 08:13:39 -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
Alex Turbov
a929dd166e FindBoost: Simplify search in lists
Instead of `list(FIND...)` and then checking result for `-1`
(found/not-found), nowadays `if` command has the `IN_LIST` test for
that.

This change was originally made by commit v3.9.0-rc1~41^2 (FindBoost:
Simplify search in lists, 2017-04-23) but then had to be reverted by
commit v3.9.2~3^2 (FindBoost: Revert "Simplify search in lists.",
2017-09-05) due to problems related to using `find_dependency`.  Those
problems were addressed by commit 3080a0a611 (FindBoost: Improve
behavior when thread dependency is missing, 2017-09-15), so now we can
restore the original change.

Issue: #17252
2017-09-18 13:44:25 -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
bc2009b724 Merge topic 'findmpi-overhaul'
bf1e606f FindMPI: Add support for FreeBSD and SLES
2f673da6 FindMPI: Support components for various languages
9a58e69c FindMPI: Modernization from ground up

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !893
2017-09-18 10:11:04 -04:00
Brad King
d31b1c0e99 Merge topic 'FindBoost-no-find_dependency'
3080a0a6 FindBoost: Improve behavior when thread dependency is missing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1272
2017-09-18 10:09:48 -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
Brad King
c29e85d009 Merge topic 'test-cleanups'
7200ab49 Tests: Fix CMake syntax warning in VSGNUFortran test
9da13bc3 Tests: Fix some references to 'cmake' executable
f1f109e9 Tests: Drop tests that have not run for over 10 years

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1270
2017-09-18 10:06:10 -04:00
Matthew Woehlke
e2cca9f8ee FindGTest: Avoid macro name collision
Use two _'s for private function/macro names rather than one. This
avoids a potential collision if a function/macro with no leading _ that
otherwise matches the name of a private function/macro also overrides a
built-in function or is defined twice.
2017-09-18 10:01:36 -04:00
Matthew Woehlke
4636c64bfe FindGTest: Improve test to catch link error
Add a reference to one of Google Test's command-line flags to the
FindGTest test. This will ensure that we are using the correct compile
definitions on Windows, as the test will otherwise fail to link. (IOW,
this tests the changes made by the previous commit.)
2017-09-18 10:01:15 -04:00
Matthew Woehlke
3506179145 FindGTest: Fix shared linking on Windows
Add logic to FindGTest.cmake to attempt to determine if the libraries
are shared or static. If the libraries are shared, add an interface
compile definition that is needed in some cases for successful linking
on Windows.

See also https://github.com/google/googletest/issues/877.
2017-09-18 10:01:13 -04:00
Brad King
507a0fd60e Merge branch 'release-3.9' 2017-09-18 09:04:17 -04:00
Brad King
ed74d9e2eb Merge topic 'backport-FindBoost-1.65'
ee1f8903 FindBoost: Add support for Boost 1.65.0 and 1.65.1 to CMake 3.9

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1280
2017-09-18 09:02:21 -04:00
Brad King
d44202ef05 Merge branch 'backport-FindBoost-1.65' into release-3.9
Merge-request: !1280
2017-09-18 08:59:30 -04:00
Roger Leigh
ee1f890332 FindBoost: Add support for Boost 1.65.0 and 1.65.1 to CMake 3.9
Backport the changes from commit fa114e7d70 (FindBoost: Add Boost 1.65
dependencies, 2017-08-22) and commit dbba53a5aa (FindBoost: Add version
1.65.1, 2017-09-06) to CMake 3.9.

Fixes: #17289
2017-09-18 08:57:18 -04:00
Brad King
f5338f799d Merge topic 'revert-vim-no-tabs'
0d543589 vim: Remove default setting of expandtab

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Maurice <m-ou.se@m-ou.se>
Merge-request: !1273
2017-09-18 08:52:12 -04:00
Brad King
c727459da9 Merge branch 'revert-vim-no-tabs' into release-3.9
Merge-request: !1273
2017-09-18 08:44:55 -04:00
Maarten de Vries
0d543589b9 vim: Remove default setting of expandtab
An update from vim-cmake-syntax by commit v3.9.0-rc1~167^2^2
(vim-cmake-syntax 2017-05-02, 2017-05-02) brought in a change to set
`expandtab` in CMake language files.  This should be a per-project or
per-user choice instead, so drop the setting.
2017-09-18 08:41:53 -04:00
Craig Scott
77eb212d07 Help: Clarify/make consistent the APPLE, UNIX and WIN32 variable docs 2017-09-18 18:57:12 +10: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
Brad King
6a2d967de0 bootstrap: Require compiler mode aware of C99 on Solaris
On Solaris some system headers included in C with `-D_XOPEN_SOURCE=600`
require C99 support by the compiler.
2017-09-17 11:10:18 -04:00