Commit Graph

26299 Commits

Author SHA1 Message Date
Brad King 8ca1b26286 cmLocalGenerator: Factor IPO logic out of AddLanguageFlags
The IPO flag logic was added to `AddLanguageFlags` based on my advice.
However, this method should really only be about `CMAKE_<LANG>_FLAGS*`
variables.  Move the IPO logic out to its call sites.
2019-04-02 14:23:32 -04:00
Brad King 3e129d71bc Merge topic 'project-include'
7d19b3091d Release note for CMAKE_PROJECT_INCLUDE variable
dda0190458 project: Add variable CMAKE_PROJECT_INCLUDE
390f14a244 Test ProjectInclude: Add NONE to avoid enabling languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3155
2019-04-01 10:49:02 -04:00
Brad King 29802ed272 Merge topic 'refactor-cmcmd'
f13aef4de5 cmcmd: Modernize for loops with cmMakeRange
e9bbfdd9a1 cmcmd: Pass args vector by const&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3168
2019-04-01 10:47:13 -04:00
Brad King fa2dbbbdde Merge topic 'utilize-substr'
2d66567dca Modernize: Prefer .substr in place of .c_str() + int

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@xwmw.org>
Merge-request: !3169
2019-04-01 10:46:24 -04:00
Brad King 6b5fb23e36 Merge topic 'fix_doxygen_comments'
735c6f39d9 Fix invalid ///! doxygen comment line starts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3170
2019-04-01 10:43:48 -04:00
Brad King 249fb7f71d Merge topic 'cmDepends_tweaks'
87341d8328 cmDepends: Define DependencyMap instead of DependencyVector
5a15c9e7cb cmDepends: Refactor cmDepends::CheckDependencies method
5f6c236481 cmFiletimeCache: Add cmFiletimeCache::Remove method
18c30786a9 cmFileTime: Make cmFileTime::Compare method const

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3156
2019-04-01 10:42:58 -04:00
Brad King 922480e6f1 Merge topic 'allow_aliasing_unkown_targets'
6d5872a396 add_library: Now support aliasing unknown import targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3148
2019-04-01 10:31:11 -04:00
Craig Scott c5eb01d4d4 Merge topic 'bug/missed-return-on-cli-errors'
99698ee351 cmake: Fix missed `return` statement when CLI errors found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3171
2019-04-01 08:57:13 -04:00
Kitware Robot 5ad73b608d CMake Nightly Date Stamp 2019-04-01 00:01:11 -04:00
Alex Turbov 99698ee351 cmake: Fix missed return statement when CLI errors found 2019-04-01 08:31:25 +11:00
Sebastian Holtermann 735c6f39d9 Fix invalid ///! doxygen comment line starts
In various places `///!` was used to start a comment line.  This is not valid
Doygen syntax.  This patch replaces `///!` comment starts with `//!`.
2019-03-31 11:27:12 +02:00
Kitware Robot 11475cc581 CMake Nightly Date Stamp 2019-03-31 00:01:07 -04:00
Artur Ryt 2d66567dca Modernize: Prefer .substr in place of .c_str() + int
A lot of temporary/local strings were created out of C-strings
substr can utilize current string size, so in theory be a little
more efficient.
2019-03-30 16:15:05 +01:00
Artur Ryt f13aef4de5 cmcmd: Modernize for loops with cmMakeRange
Also minor loop variable renaming
2019-03-30 15:39:45 +01:00
Artur Ryt e9bbfdd9a1 cmcmd: Pass args vector by const& 2019-03-30 15:34:59 +01:00
Kitware Robot 5bdee37863 CMake Nightly Date Stamp 2019-03-30 00:01:09 -04:00
Brad King 5674018cc6 Merge topic 'implicit-includes-autogen'
a8b7cbb787 Autogen: Do not treat hard-coded -I/usr/include exclusion as implicit include

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3159
2019-03-29 09:11:04 -04:00
Brad King e532052a0a Merge topic 'update-kwsys'
15be06a5ec Tests: Fix Plugin test for international characters on Windows
24da7da686 Merge branch 'upstream-KWSys' into update-kwsys
8166634958 KWSys 2019-03-28 (e92bdbe8)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3158
2019-03-29 09:08:07 -04:00
Kitware Robot 45ec5a2270 CMake Nightly Date Stamp 2019-03-29 00:01:05 -04:00
Sebastian Holtermann a8b7cbb787 Autogen: Do not treat hard-coded -I/usr/include exclusion as implicit include
The `cmLocalGenerator::GetIncludeDirectoriesImplicit` method is called
by `cmQtAutoGenInitializer` to get the compiler's list of implicit
include directories.  Since commit 557b2d6e65 (Fix regression in
-I/usr/include exclusion logic, 2019-02-13, v3.14.0-rc2~6^2~2) the
method hard-codes exclusion of `/usr/include` for historical reasons.
However, it should not be reported as a real implicit include directory
unless the compiler really has it.

Refactor the logic to distinguish the hard-coded exclusion of
`/usr/include` from the real list of implicit include directories.

Fixes: #19100
2019-03-28 14:07:24 -04:00
Brad King 24da7da686 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2019-03-28 (e92bdbe8)
2019-03-28 11:06:43 -04:00
Kitware Robot 14b6cd497f CMake Nightly Date Stamp 2019-03-28 00:01:07 -04:00
Ruslan Baratov dda0190458 project: Add variable CMAKE_PROJECT_INCLUDE 2019-03-27 22:39:02 +03:00
Brad King 9cf64bb101 Merge branch 'jacoco_parser_crash' into release-3.14
Merge-request: !3147
2019-03-27 14:20:45 -04:00
Brad King a60f1c4faf Merge topic 'jacoco_parser_crash'
1d16eae868 ctest_coverage: fix out-of-bounds index in Jacoco parser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3147
2019-03-27 14:11:57 -04:00
Brad King fcfbc01d68 Merge topic 'cmTarget_pimpl'
de0d57c97a cmTarget: Use std::unique_ptr instead of custom smart pointer
ecc782c75d cmTarget: Single line comment clanups
be2764a657 cmTarget: Make private `SetPropertyDefault` an in code lambda `InitProperty`
2bfee8a58b cmTarget: Remove obsolete `friend` definitions
a65a404186 cmTarget: Inline private HasImportLibrary method
ff91071a14 cmTarget: Move member method `CheckImportedLibName` to impl
afc4612fa5 cmTarget: Move member method `ProcessSourceItemCMP0049()` to impl
72b0eeeb21 cmTarget: Move member booleans to impl
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !3142
2019-03-27 13:25:35 -04:00
Sebastian Holtermann 87341d8328 cmDepends: Define DependencyMap instead of DependencyVector
In `cmDepends` use
`typedef std::map<std::string, std::vector<std::string>> DependencyMap`
instead of defining a
`class DependencyVector : public std::vector<std::string>`
and using it in `std::map<std::string, DependencyVector>`.

Since `std::map<std::string, std::vector<std::string>>` is used in various
other places, we now reuse all of it's auto generated methods.  This doesn't
happen when we use `DependencyVector` in a `std::map`, because it is a
different class than `std::vector<std::string>`.
2019-03-27 18:12:43 +01:00
Sebastian Holtermann 5a15c9e7cb cmDepends: Refactor cmDepends::CheckDependencies method
This patch changes the following issues in `cmDepends::CheckDependencies`:

- Use the `std::string` based `std::getline` interface to read lines from a
  file instead of using raw reads into raw buffers.
- To reduce the file system access, we load file times only once from
  `cmFileTimeCache` and keep them on the stack for later comparison.
- When a file is removed from the file system we remove it from the
  `cmFileTimeCache` as well.
2019-03-27 18:11:36 +01:00
Sebastian Holtermann 5f6c236481 cmFiletimeCache: Add cmFiletimeCache::Remove method 2019-03-27 18:09:53 +01:00
Sebastian Holtermann 18c30786a9 cmFileTime: Make cmFileTime::Compare method const 2019-03-27 18:09:53 +01:00
Kitware Robot d2c0350c7b CMake Nightly Date Stamp 2019-03-27 00:01:08 -04:00
Robert Maynard 6d5872a396 add_library: Now support aliasing unknown import targets
Fixes #18327
2019-03-26 15:54:48 -04:00
Sylvain Joubert 1d16eae868 ctest_coverage: fix out-of-bounds index in Jacoco parser
When the current source file is not found the FilePath variable was left
with the previous path content. In case the previous file had less lines
than the current one and there are 'line' entries for the current one
with higher number we ended up in a buffer overflow while indexing the
previous file entry with a line number higher.  By clearing the
FilePath, the empty() guard triggers correctly on an empty path and it
avoid modifying the wrong data.
2019-03-26 11:50:30 -04:00
Brad King 36611418ab Merge topic 'cmGlobalGenerator_code_maintenance'
b289243d99 cmGlobalGenerator: Inline `aRange` acquisition in `for(x:aRange)` invocations
bf9afa1e15 cmGlobalGenerator: Use auto for long iterator types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !3144
2019-03-26 11:00:44 -04:00
Brad King f288383b3f Merge topic 'fix_autogen_deadlock'
e7a760fe7d Autogen: Fix deadlock when uv_spawn() fails while trying to run moc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: Sebastian Holtermann <sebholt@xwmw.org>
Merge-request: !3139
2019-03-26 10:59:57 -04:00
Brad King 8494bc2713 Merge topic 'toolchain-include_directories'
588fa1bb9e Restore support for include_directories() in toolchain files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3140
2019-03-26 10:56:34 -04:00
Kitware Robot db20cb2f9f CMake Nightly Date Stamp 2019-03-26 00:01:07 -04:00
Brad King 9fbad8b40b Merge topic 'ctest_submit_get_buildid'
ba7e44eb7a ctest_submit: Add option BUILD_ID

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Merge-request: !3120
2019-03-25 11:52:25 -04:00
Brad King c22a2b49af Merge branch 'toolchain-include_directories' into release-3.14
Merge-request: !3140
2019-03-25 11:50:06 -04:00
Brad King 588fa1bb9e Restore support for include_directories() in toolchain files
Any `include_directories()` calls in toolchain files are used during our
ABI detection step even though it does not include any system headers.
Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2), that check is also used
to detect implicit include directories.  Any `include_directories()` in
a toolchain file are detected as implicit and later excluded from
explicit specification on compiler command lines, thus breaking the
purpose of the calls in the first place.

Fix the implicit include directory detection step to avoid using paths
from `include_directories()` calls in the toolchain file.

Fixes: #19079
2019-03-25 11:48:17 -04:00
Sebastian Holtermann b289243d99 cmGlobalGenerator: Inline aRange acquisition in for(x:aRange) invocations
Changes the following code snippets in `cmGlobalGenerator`
```
AType aRange = object.getRange();
for ( auto & item: aRange) {
```
to

```
for ( auto & item: object.getRange()) {
```
2019-03-25 13:51:22 +01:00
Sebastian Holtermann bf9afa1e15 cmGlobalGenerator: Use auto for long iterator types 2019-03-25 13:51:22 +01:00
Alexandru Croitor e7a760fe7d Autogen: Fix deadlock when uv_spawn() fails while trying to run moc
If by some chance the moc executable does not exist while running
AUTOMOC, instead of showing an error, the CMake Autogen invocation
hangs indefinitely.

This happens because UVProcessFinished() is not called if the process
does not launch correctly.

Make sure to call UVProcessFinished() even if the process launch fails,
and also report the error returned by libuv.
2019-03-25 11:43:14 +01:00
Kitware Robot e7fb007b61 CMake Nightly Date Stamp 2019-03-25 00:01:08 -04:00
Kitware Robot c85f23a016 CMake Nightly Date Stamp 2019-03-24 00:01:07 -04:00
Sebastian Holtermann de0d57c97a cmTarget: Use std::unique_ptr instead of custom smart pointer
To manage the lifetime of `cmTargetInternals`, the private implementation of
`cmTarget`, use `std::unique_ptr<cmTargetInternals>` instead of
`cmTargetInternalPointer`, which is removed.

`cmTarget` is made non-copyable but movable.
2019-03-23 22:22:34 +01:00
Sebastian Holtermann ecc782c75d cmTarget: Single line comment clanups 2019-03-23 22:22:34 +01:00
Sebastian Holtermann be2764a657 cmTarget: Make private SetPropertyDefault an in code lambda InitProperty 2019-03-23 22:22:34 +01:00
Sebastian Holtermann 2bfee8a58b cmTarget: Remove obsolete friend definitions 2019-03-23 22:22:34 +01:00
Sebastian Holtermann a65a404186 cmTarget: Inline private HasImportLibrary method 2019-03-23 22:22:34 +01:00