Commit Graph

26547 Commits

Author SHA1 Message Date
Brad King
0064edf417 Merge topic 'ninja-pool-custom-command'
9f76961de8 Support job pools in custom commands and targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3308
2019-05-15 09:21:08 -04:00
Brad King
ac0411f166 Merge topic 'cmuvprocesschain-iterator-fix'
dfa24355ea cmUVProcessChain: Add assert() for static analysis tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3322
2019-05-15 09:19:43 -04:00
Kitware Robot
38bedaef72 CMake Nightly Date Stamp 2019-05-15 00:01:07 -04:00
Kyle Edwards
dfa24355ea cmUVProcessChain: Add assert() for static analysis tools
Some static analysis tools throw a false positive for an
out-of-bounds item that is being dereferenced. This out-of-bounds
error will never actually happen because of how
cmUVProcessChain::InternalData::AddCommand() is being called.
Nevertheless, this change adds an assert() to help static analysis
tools be absolutely certain that the referenced item is within the
vector's bounds.

This change also changes the item access to use an index rather
than an iterator.
2019-05-14 14:00:13 -04:00
Brad King
2389fcc677 Merge topic 'find-boost-cmp0093'
5108759ed2 FindBoost: Introduce CMP0093 to report Boost_VERSION in x.y.z format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3317
2019-05-14 11:14:33 -04:00
Brad King
1f0a695561 Merge topic 'cmSytemTools_ExpandedList'
cdff7f4e2a cmSystemTools: Add ExpandedListArgument and ExpandedLists methods

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !3313
2019-05-14 10:58:43 -04:00
Brad King
bae7a2e250 Merge topic 'error-generate-step'
8cc04b1918 cmake: Display error if generate step fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !3304
2019-05-14 10:57:44 -04:00
Brad King
050bf57472 Merge topic 'ninja_cleanups'
054954d855 Ninja: Use clean target instead of clean tool in `cmake --target clean` calls
30a550d6ad Ninja: In cmNinjaTargetGenerator use std::unique_ptr to manage new instances
0024356f8e Ninja: In cmNinjaTargetGenerator optimize string composition
8691b3cf91 Ninja: Inline range loop range arguments
47da9859e8 Ninja: In cmGlobalNinjaGenerator use std::unique_ptr to manage output streams
9902702134 Ninja: Add and use cmGlobalNinjaGenerator::CMakeCmd method
12aa6fe07b Ninja: Fix message in cmGlobalNinjaGenerator::WriteBuild method
02293841e7 Ninja: Simplify cmGlobalNinjaGenerator::AddRule and HasRule methods
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3312
2019-05-14 10:56:29 -04:00
Brad King
0302d40faa Merge topic 'cminstallgenerator-compute-error'
b133d14fb1 Refactor: Allow cmInstallGenerator::Compute() to return an error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3305
2019-05-14 10:54:53 -04:00
Rosen Matev
9f76961de8 Support job pools in custom commands and targets
Provide a way for custom commands and targets to set the pool variable
of the ninja build statement. Setting `JOB_POOL` is not compatible with
`USES_TERMINAL`, which implies the `console` pool.

The option is silently ignored with other generators.

Closes: #18483
2019-05-14 15:58:00 +02:00
Kitware Robot
9d48d3f61b CMake Nightly Date Stamp 2019-05-14 00:01:07 -04:00
Dennis Klein
5108759ed2 FindBoost: Introduce CMP0093 to report Boost_VERSION in x.y.z format
This aligns module mode behaviour with config mode.
2019-05-13 11:57:12 -04:00
Sebastian Holtermann
054954d855 Ninja: Use clean target instead of clean tool in cmake --target clean calls
A convenience `clean` target for the Ninja generator exists since commit
3bd41f2eb5.  It's safe to call `ninja clean` instead of `ninja -t clean`.
This removes the exception mapping of the `clean` target in
`cmake --build ... --target clean` calls to the Ninja `-t clean` tool.
2019-05-13 17:20:28 +02:00
Sebastian Holtermann
30a550d6ad Ninja: In cmNinjaTargetGenerator use std::unique_ptr to manage new instances 2019-05-13 17:20:27 +02:00
Sebastian Holtermann
0024356f8e Ninja: In cmNinjaTargetGenerator optimize string composition 2019-05-13 17:20:23 +02:00
Kyle Edwards
b133d14fb1 Refactor: Allow cmInstallGenerator::Compute() to return an error
This is preparation for an upcoming merge request, which will add
a new cmInstallGenerator that returns false if there are errors in
the Compute() step.
2019-05-13 10:45:36 -04:00
Brad King
f9feab40a1 Merge topic 'autorcc_timestamp'
15004e4319 AutoRcc: Simplify error logging with utility lambda
bd6c3f8609 AutoRcc: Rebuild if the rcc executable is newer than its output
54903af84b AutoRcc: Don't read the info file time again
081104fb00 AutoRcc: Write re-generation reason and rcc command as one string
eff6e622d6 Autogen: A missing info file is a critical error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3311
2019-05-13 10:42:02 -04:00
Brad King
df6c4afa77 Merge topic 'cmuvprocesschain'
26025d6e10 cmUVProcessChain: Add cmUVProcessChain
6b04d1cdc2 cmUVStreambuf: Initialize all members on construction

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3275
2019-05-13 10:38:09 -04:00
Kyle Edwards
8cc04b1918 cmake: Display error if generate step fails 2019-05-13 10:31:39 -04:00
Brad King
9af34615ae Merge topic 'windows-signing'
9a34031081 Utilities/Release: Enable signing of Windows release binaries
29f4f70b41 Add undocumented option to sign CMake's own binaries on Windows
1069a3f02b Configure CMake itself with policies through CMake 3.14

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3296
2019-05-13 09:57:43 -04:00
Sebastian Holtermann
cdff7f4e2a cmSystemTools: Add ExpandedListArgument and ExpandedLists methods
Changes
-------

In `cmSystemTools` this
- renames the method `ExpandList` to `ExpandLists` and makes it iterator based

and adds the methods
- `std::vector<std::string> ExpandedLists(InputIt first, InputIt last)`
- `std::vector<std::string> ExpandedListArgument(const std::string& arg,
                                                       bool emptyArgs)`

Both return the  `std::vector<std::string>` instead of taking a return vector
reference like `cmSystemTools::ExpandLists` and
`cmSystemTools::ExpandListArgument`.

Motivation
----------

Since C++17 return value optimization is mandatory, so returning a
`std:vector<std::string>` from a function should be (at least) as fast as
passing a return vector reference to the function.

The new methods can replace `cmSystemTools::ExpandLists` and
`cmSystemTools::ExpandListArgument` in many cases, which leads to
shorter and simpler syntax.

E.g. the commonly used pattern
```
  if (const char* value = X->GetProperty("A_KEY_STRING")) {
    std::vector<std::string> valuesList;
    cmSystemTools::ExpandListArgument(value, valuesList);
    for (std::string const& i : valuesList) {
      doSomething(i);
    }
  }
```
becomes
```
  if (const char* value = X->GetProperty("A_KEY_STRING")) {
    for (std::string const& i :
      cmSystemTools::ExpandedListArgument(value)) {
      doSomething(i);
    }
  }
```
2019-05-13 15:37:18 +02:00
Kitware Robot
a8f1527ba4 CMake Nightly Date Stamp 2019-05-13 00:01:10 -04:00
Sebastian Holtermann
8691b3cf91 Ninja: Inline range loop range arguments 2019-05-12 18:56:53 +02:00
Kitware Robot
9d2ea14492 CMake Nightly Date Stamp 2019-05-12 00:01:04 -04:00
Sebastian Holtermann
15004e4319 AutoRcc: Simplify error logging with utility lambda 2019-05-11 22:15:47 +02:00
Sebastian Holtermann
bd6c3f8609 AutoRcc: Rebuild if the rcc executable is newer than its output
In AUTORCC add a test if the rcc executable is newer that the rcc output.
If the rcc executable is newer, rebuild the output.
2019-05-11 22:15:47 +02:00
Sebastian Holtermann
54903af84b AutoRcc: Don't read the info file time again
In `AUTORCC` use the info file time that's available already instead of
reading it again.
2019-05-11 22:15:47 +02:00
Sebastian Holtermann
081104fb00 AutoRcc: Write re-generation reason and rcc command as one string
In AUTORCC with verbose output write the rcc re-generation reason and
the rcc command as on single string to avoid message chopping in concurrent
builds.
2019-05-11 21:23:29 +02:00
Sebastian Holtermann
eff6e622d6 Autogen: A missing info file is a critical error 2019-05-11 21:17:05 +02:00
Sebastian Holtermann
47da9859e8 Ninja: In cmGlobalNinjaGenerator use std::unique_ptr to manage output streams 2019-05-11 15:51:30 +02:00
Kitware Robot
e329944d09 CMake Nightly Date Stamp 2019-05-11 00:01:05 -04:00
Sebastian Holtermann
9902702134 Ninja: Add and use cmGlobalNinjaGenerator::CMakeCmd method 2019-05-10 20:22:26 +02:00
Sebastian Holtermann
12aa6fe07b Ninja: Fix message in cmGlobalNinjaGenerator::WriteBuild method 2019-05-10 20:22:26 +02:00
Sebastian Holtermann
02293841e7 Ninja: Simplify cmGlobalNinjaGenerator::AddRule and HasRule methods
- Use `std::unordered_set` for the emitted rule register
- Use `std::unordered_map` for command length register
2019-05-10 20:22:26 +02:00
Sebastian Holtermann
a173a1173e Ninja: Simplify cmGlobalNinjaGenerator::WriteRule method 2019-05-10 20:22:26 +02:00
Kitware Robot
62e826d11b CMake Nightly Date Stamp 2019-05-10 00:01:05 -04:00
Kitware Robot
5a2023f904 CMake Nightly Date Stamp 2019-05-09 00:01:04 -04:00
Brad King
29f4f70b41 Add undocumented option to sign CMake's own binaries on Windows 2019-05-08 13:18:31 -04:00
Brad King
0af57a1852 Merge topic 'autogen_cache'
7d50e1c611 Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data caching

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3290
2019-05-08 12:41:15 -04:00
Craig Scott
4aace9b015 Merge topic 'ctest-update-version-override'
2a34d0ac36 ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE
7ddac95121 Help: cross-ref and wording of docs related to ctest_update()
a0d04d8810 testing: Update terminology in ctest_update tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Merge-request: !3277
2019-05-08 08:49:34 -04:00
Kitware Robot
afd7df9d1c CMake Nightly Date Stamp 2019-05-08 00:01:05 -04:00
Kyle Edwards
26025d6e10 cmUVProcessChain: Add cmUVProcessChain
This class is ultimately intended as a replacement for cmsys::Process.
It spawns a series of processes using libuv, piping the output of each
command into the next.

Note: input support has not yet been implemented because write
support has not yet been implemented on cmUVStreambuf.
2019-05-07 13:40:06 -04:00
Brad King
6b04d1cdc2 cmUVStreambuf: Initialize all members on construction
Avoid leaving any members uninitialized after construction even if they
are later initialized before use by methods.  This helps convince static
analysis tools that the members are not used uninitialized.
2019-05-07 12:35:22 -04:00
Brad King
fa077acba5 Merge topic 'enforce-explicit-use-of-project'
1527defbfe cmMakefile: Enforce explicit use of project() command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3245
2019-05-07 11:17:26 -04:00
Brad King
1628e4677a Merge topic 'touch-after-ranlib'
f83e4359f2 Apple: Preserve high resolution mtime for static libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3283
2019-05-07 11:12:38 -04:00
Zack Galbreath
2a34d0ac36 ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE
Set this in a CTest script to explicitly define what the current revision
will be reported as in Update.xml.
2019-05-07 10:45:47 -04:00
Sebastian Holtermann
7d50e1c611 Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data caching
New features
------------

CMake's `AUTOMOC` and `AUTOUIC` now cache information extracted when parsing
source files in `CMakeFiles/<ORIGIN>_autogen.dir/ParseCache.txt`.
This leads to faster `<ORIGIN>_autogen` target rebuilds, because source files
will be parsed again only if they're newer than the `ParseCache.txt` file.
The parse cache will be recomputed if it is older than the CMake executable.

`AUTOMOC` and `AUTOUIC` now check if `moc` or `uic` output files are older
than the `moc` or `uic` executable.  If an output file is older than the
compiler, it will be regenerated.  Therefore if a new `moc` or `uic` version
is installed, all output files will be regenerated.

`AUTOMOC` and `AUTOUIC` error and warning messages are more detailed.

Internal changes
----------------

`moc` and `uic` output file names are not computed in the `_autogen`
target anymore but in `cmQtAutoGenInitializer`.  This makes the available at
the configuration stage for improved dependency computations (to be done).

In `AutogenInfo.cmake`, equally sized lists for "source file names",
"source file flags" and "compiler output file names" are passed to the
`_autogen` target.  This replaces the separate file lists for
`AUTOMOC` and `AUTOUIC`.

Files times are read from the file system only once by using `cmFileTime`
instances instead of `cmQtAutoGenerator::FileSystem::FileIsOlderThan` calls.

All calls to not thread safe file system functions are moved to non concurrent
fence jobs (see `cmWorkerPool::JobT::IsFence()`).  This renders the
`cmQtAutoGenerator::FileSystem` wrapper class obsolete and it is removed.

Instead of composing a single large settings string that is fed to the
`cmCryptoHash`, now all setting sub strings are fed one by one to the
`cmCryptoHash` and the finalized result is stored.

The `std::mutex` in `cmQtAutoGenerator::Logger` is tagged `mutable` and most
`cmQtAutoGenerator::Logger` methods become `const`.

Outlook
-------

This patch provides the framework required to

- extract dependencies from `.ui` files in `AUTOUIC`.
  These will help to address issue
  #15420 "AUTOUIC: Track uic external inputs".

- generate adaptive `make` and `ninja` files in the `_autogen` target.
  These will help to address issue
  #16776 "AUTOUIC: Ninja needs two passes to correctly build Qt project".

- generate (possibly empty) `moc` and `uic` files for all headers instead of a
  `mocs_compilation.cpp` file.
  This will help to address issue
  #17277 "AUTOMOC: Provide a option to allow AUTOMOC to compile individual "
         "moc_x.cxx instead of including all in mocs_compilation.cxx"
2019-05-07 12:42:19 +02:00
Kitware Robot
9bf6cbc8f7 CMake Nightly Date Stamp 2019-05-07 00:01:05 -04:00
Brad King
f0185ff14a Merge topic 'fix_ios_try_compile'
275b6b3194 iOS: Fix try_compile FILE_COPY not to fail

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3272
2019-05-06 09:32:25 -04:00
Alexandru Croitor
275b6b3194 iOS: Fix try_compile FILE_COPY not to fail
When building for iOS, the compiled target is placed into a bundle.
If a single-configuration generator is used, like Makefiles or Ninja,
the try_compile FILE_COPY behavior fails to find the bundle, because
it only looks for the bundle inside a Debug subfolder (presumably
to support a multi-configuration generator like Xcode).

Consider looking for the bundle in the root try_compile folder, as
well as in the location specified by CMAKE_TRY_COMPILE_CONFIGURATION.

Closes: #19211
2019-05-06 09:23:27 -04:00