Commit Graph

26570 Commits

Author SHA1 Message Date
Sebastian Holtermann
827da1119e Makefiles: Make build root targets "all", "clean" and "preinstall" recursive
In the "Unix Makefiles" generator, the subdirectory targets "all", "clean" and
"preinstall" in Makefile2 are recursive.  In the build root directory,
these targets aren't.  Instead they're are added separately and additional
dependencies are added on a per target basis.  This is inconsistent and it
complicates per directory commands, like a per directory clean command.

This patch makes the "all", "clean" and "preinstall" targets in Makefile2
in the build root directory recursive, using the same algorithm that is
already used for subdirectories.

Some side effects are:
- Makefile2 gets smaller and simpler
- The main "all", "clean" and "preinstall" targets have recursive dependencies,
  instead of flat (depth of 1) ones.
2019-05-18 12:06:49 +02:00
Sebastian Holtermann
adc3459707 Makefiles: Avoid pointer repurposing 2019-05-17 17:58:55 +02:00
Sebastian Holtermann
0d41b45cc9 Makefiles: Inline range loop range arguments 2019-05-17 17:58:55 +02:00
Brad King
e1c95bc278 Merge topic 'autogen_ninja_clean'
93ee7dd044 Autogen: Update documentation for ADDITIONAL_CLEAN_FILES
4b4fd99f41 Autogen: Use ADDITIONAL_CLEAN_FILES target property for file cleaning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3327
2019-05-17 09:38:44 -04:00
Brad King
acc2f022bb Merge topic 'offer_compiler_lang_generator_expression'
e214abdaab Genex: Add COMPILE_LANG_AND_ID generator expression
f84ed796a2 Docs: Generator-expressions remove usage of `CMake-id`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3300
2019-05-17 09:27:12 -04:00
Brad King
3020354f7c Merge topic 'string-cleanup'
23e8364aed Source: std::string related cleanup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Merge-request: !3324
2019-05-17 09:26:05 -04:00
Kitware Robot
736f9d184d CMake Nightly Date Stamp 2019-05-17 00:01:05 -04:00
Brad King
62b0d14e24 Merge topic 'update-kwsys'
23b3ca5e1f Merge branch 'upstream-KWSys' into update-kwsys
49f8351a18 KWSys 2019-05-15 (dea11658)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3325
2019-05-16 10:19:51 -04:00
Kitware Robot
82c6ec964d CMake Nightly Date Stamp 2019-05-16 00:01:06 -04:00
Brad King
9ee24ede73 Merge topic 'msvc-jmc'
2a9ff9703e MSVC: Add support for /JMC (Just My Code)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3121
2019-05-15 14:06:58 -04:00
Vitaly Stakhovsky
23e8364aed Source: std::string related cleanup 2019-05-15 10:20:05 -04:00
Sebastian Holtermann
4b4fd99f41 Autogen: Use ADDITIONAL_CLEAN_FILES target property for file cleaning
The `ADDITIONAL_CLEAN_FILES` target property works on multiple generators
to remove addition files at the clean target.  In `AUTOGEN` use it instead of
the deprecated and limited `ADDITIONAL_MAKE_CLEAN_FILES` directory property
to remove `AUTOGEN` generated files.

Fixes: #17074 "Autogen: clean target with ninja generator doesn’t clean
               autogen files"
2019-05-15 15:28:17 +02:00
Brad King
66efdbd21a Merge topic 'additional_clean_files'
b5bf369ec6 Release notes: Add release notes for ADDITIONAL_CLEAN_FILES properties
4e2ce0a67a Doc: Update and deprecate ADDITIONAL_MAKE_CLEAN_FILES directory property
338994d65d Doc: Add documentation for ADDITIONAL_CLEAN_FILES properties
c11f089d73 Tests: Extend MakeClean test to cover ADDITIONAL_CLEAN_FILES
012d599e26 Ninja: Add support for ADDITIONAL_CLEAN_FILES target property
890a1b9dc3 Ninja: Add support for ADDITIONAL_CLEAN_FILES directory property
7b23001f20 Ninja: Add support for additional clean files
d745df4b01 Makefiles: Add support for ADDITIONAL_CLEAN_FILES target property
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3318
2019-05-15 09:22:18 -04:00
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
Brad King
23b3ca5e1f Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2019-05-15 (dea11658)
2019-05-15 09:10:03 -04:00
Kitware Robot
38bedaef72 CMake Nightly Date Stamp 2019-05-15 00:01:07 -04:00
Robert Maynard
e214abdaab Genex: Add COMPILE_LANG_AND_ID generator expression 2019-05-14 14:54:15 -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
Luca Cappa
2a9ff9703e MSVC: Add support for /JMC (Just My Code) 2019-05-14 13:27:18 -04:00
Sebastian Holtermann
012d599e26 Ninja: Add support for ADDITIONAL_CLEAN_FILES target property 2019-05-14 17:50:14 +02:00
Sebastian Holtermann
890a1b9dc3 Ninja: Add support for ADDITIONAL_CLEAN_FILES directory property 2019-05-14 17:50:14 +02:00
Sebastian Holtermann
7b23001f20 Ninja: Add support for additional clean files
Additional clean files for the Ninja generator can be registered
via the new method `cmGlobalNinjaGenerator::AddAdditionalCleanFile`.
If there are additional clean files, a new rule `CLEAN_ADDITIONAL` and
a new build target `CMakeFiles/clean.additional` get generated.
The `clean` target will depend on `CMakeFiles/clean.additional`, if the target
exists.
2019-05-14 17:50:14 +02:00
Sebastian Holtermann
d745df4b01 Makefiles: Add support for ADDITIONAL_CLEAN_FILES target property 2019-05-14 17:50:14 +02:00
Sebastian Holtermann
124ec11720 Makefiles: Add support for ADDITIONAL_CLEAN_FILES directory property 2019-05-14 17:50:14 +02:00
Sebastian Holtermann
43640fc80a Makefiles: Move ADDITIONAL_MAKE_CLEAN_FILES evaluation to lambda 2019-05-14 17:50:14 +02:00
Sebastian Holtermann
7c8c18b1e6 Makefiles: Sort clean files by using a std::set<std::string> container
By using a `std::set<std::string>` container instead of a
`std::vector<std::string>` container, the clean files list becomes sorted and
unique.  The clean target in Makefiles beomes nicer and better readable this
way.  Also double clean entries won't appear anymore.
2019-05-14 17:50:13 +02: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