Commit Graph

49781 Commits

Author SHA1 Message Date
Brad King 5a15fcf597 Tests: Avoid duplicate custom commands in QtAutogen.AutogenOriginDependsOff 2020-09-18 12:49:09 -04:00
Brad King 0fa9392583 Tests: Remove RunCMake.ExternalProject unnecessary CMake version check 2020-09-15 14:05:43 -04:00
Brad King 52a1ba62df Tests: Simplify RunCMake.ExternalProject Add_StepDependencies stderr
Set CMP0114 to OLD for this case to suppress the policy warning.
The warning is covered by the `NO_DEPENDS-CMP0114-WARN` case.
2020-09-15 11:20:07 -04:00
Brad King de9a2f1ef6 Help: Move CMAKE_XCODE_GENERATE_SCHEME to proper manual section 2020-09-14 13:14:38 -04:00
Brad King b4fc4da903 ExternalProject: Add policy CMP0114 to refine step target dependencies
`ExternalProject_Add_StepTargets` and `INDEPENDENT_STEP_TARGETS` have
some limitations and lack some sanity checks.  They can cause confusing
build systems to be generated.  The basic problems are:

* The notion of step independence is attached to the step target
  rather than the step itself.

* The custom commands implementing the steps are duplicated in the
  step targets and the primary targets.  This can cause races.
  It is also incompatible with the Xcode "new build system".

Fix this by introducing policy CMP0114 to change the way step target
dependencies are handled.  Define independence from external
dependencies as a property of each individual step regardless of whether
there is a target for it.  Add dependencies among the primary target and
the step targets such that each custom command only appears in one
target.  When some steps are disconnected from the primary target, add
step targets for the steps commonly depended upon so that there is a
place to hold their custom commands uniquely.

Fixes: #18663
2020-09-14 10:48:16 -04:00
Brad King f5791e24c6 Tests: Match RunCMake.ExternalProject NO_DEPENDS output more strictly 2020-09-10 18:14:23 -04:00
Brad King b637ef494c ExternalProject: Factor out an internal helper to add a step target 2020-09-10 18:14:23 -04:00
Brad King 48ed3bae58 Merge topic 'pch-instantiate-templates'
8c8f03422e PCH: Template instantiation support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5168
2020-09-10 16:32:39 -04:00
Brad King e32f4da74a Merge topic 'fix_add_library_documentation'
0a5c3e3b97 Help: add_library(<name> OBJECT) can omit the source files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5212
2020-09-10 16:05:53 -04:00
Brad King 5b3644fba6 Merge branch 'release-3.18' 2020-09-10 16:02:56 -04:00
Brad King 99044f8e16 Merge topic 'gitlab-ci-prefer-mr'
f6a80ffd54 gitlab-ci: Prefer MR rules for any pipeline associated with a MR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5214
2020-09-10 16:02:56 -04:00
Brad King 06cb6a1628 Merge topic 'gitlab-ci-prefer-mr' into release-3.18
f6a80ffd54 gitlab-ci: Prefer MR rules for any pipeline associated with a MR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5214
2020-09-10 16:02:56 -04:00
Brad King f6a80ffd54 gitlab-ci: Prefer MR rules for any pipeline associated with a MR
GitLab 13.3 started creating MR pipelines in the parent project of a MR
from a fork, at least when the MR submitter is a developer in the parent
project.  If the pipeline is associated with a MR, we should use the
corresponding rules regardless of which project hosts the pipeline.
2020-09-10 15:48:13 -04:00
Deniz Bahadir 0a5c3e3b97 Help: add_library(<name> OBJECT) can omit the source files 2020-09-10 16:59:34 +02:00
Brad King 487c711230 Merge topic 'custom-command-dedup'
45fedf0e17 Makefile: Add policy CMP0113 to avoid duplication of custom commands
844779bdc1 cmMakefileTargetGenerator: Simplify custom command output collection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5204
2020-09-10 10:12:30 -04:00
Brad King db3efb7568 Merge topic 'json-helpers'
b2f3f831e2 Refactor: Use JSON helpers in CTest resource spec
3f3a30e1e0 JSON: Add helpers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5197
2020-09-10 10:09:42 -04:00
Brad King 2eb7ff09c7 Merge topic 'optimize-old-expand'
62d7acc6d4 cmCommandArgumentParserHelper: rework input handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5208
2020-09-10 09:57:43 -04:00
Brad King 965bf3c904 Merge branch 'release-3.18' 2020-09-10 09:45:53 -04:00
Brad King 9b5f167348 Merge topic 'automoc-rerun-missing-dependency' into release-3.18
9ac3503d30 AutoMoc: Re-run moc if a dependency is missing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5180
2020-09-10 09:45:52 -04:00
Brad King 8fe4d18e1a Merge topic 'automoc-rerun-missing-dependency'
9ac3503d30 AutoMoc: Re-run moc if a dependency is missing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5180
2020-09-10 09:45:52 -04:00
Kitware Robot 67355ac5de CMake Nightly Date Stamp 2020-09-10 00:01:13 -04:00
Kyle Edwards b2f3f831e2 Refactor: Use JSON helpers in CTest resource spec 2020-09-09 12:48:29 -04:00
Brad King 51fc3ac972 Merge topic 'vs9-custom-command-dedup'
066f4d0f0a VS: Avoid unnecessary duplication of custom commands across targets in VS 9
8bb5c96bf8 cmLocalVisualStudio7Generator: Adopt SourcesVisited lookup table

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5206
2020-09-09 11:28:20 -04:00
Brad King 7a73164b4a Merge topic 'use-cmprop'
dae5fe8b8f cmConditionEvaluator: More use of cmProp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5190
2020-09-09 11:27:22 -04:00
Brad King f2e42c8369 Merge topic 'file-real_path'
be36266dab file(): Add REAL_PATH sub-command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5202
2020-09-09 11:26:26 -04:00
Brad King a09e9f98c0 Merge topic 'fix-crash-21165'
a46fdda464 cmGeneratorTarget: Avoid missing nullptr check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5191
2020-09-09 11:25:25 -04:00
Brad King 8de27c599f Merge topic 'pch-tv90' into release-3.18
ce7c100545 PCH: Fix 30s wait for VS2008 when used via -Tv90

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5199
2020-09-09 11:24:34 -04:00
Brad King 517273c790 Merge branch 'release-3.18' 2020-09-09 11:24:34 -04:00
Brad King 7710c94009 Merge topic 'pch-tv90'
ce7c100545 PCH: Fix 30s wait for VS2008 when used via -Tv90

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5199
2020-09-09 11:24:34 -04:00
Brad King 802584f0c2 Merge topic 'ios-pch-x-lang-header' into release-3.18
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5188
2020-09-09 11:23:34 -04:00
Brad King 5e0e78b859 Merge branch 'release-3.18' 2020-09-09 11:23:34 -04:00
Brad King 6d77487eb7 Merge topic 'ios-pch-x-lang-header'
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5188
2020-09-09 11:23:34 -04:00
Oleksandr Koval 62d7acc6d4 cmCommandArgumentParserHelper: rework input handling
Old implementation uses involved Flex input management technique that
requires usage of obsolete YY_INPUT macro. This causes a lot of useless
allocations and byte-by-byte scanning. New implementation avoids those
hacks, it uses yy_scan_string() API to setup Flex input. Also it fixes
reporting of syntax error position and corresponding tests.
2020-09-09 15:49:35 +03:00
Kyle Edwards 3f3a30e1e0 JSON: Add helpers 2020-09-09 08:29:02 -04:00
Kyle Edwards e366977e62 Merge topic 'cmstrlen'
0c9cdf30ed cmStringAlgorithms: Add cmStrLen()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5201
2020-09-09 08:21:26 -04:00
Joerg Bornemann 9ac3503d30 AutoMoc: Re-run moc if a dependency is missing
AutoMoc uses the moc-emitted dependency file of Qt 5.15 to track
dependencies. Such a dependency may well live outside the project and
can vanish, for example when installing a new compiler version.

This situation was detected before, but merely a warning was issued.
Now, we're considering a generated file as out of date if a dependency
is missing and re-generate it.

We also have to remove the missing dependency from the ParseCache.
Otherwise the AUTOMOC target for all generators other than Ninja will
always be out of date.

The ParseCacheChanged flag had to be made atomic, because we're
potentially accessing it from multiple threads. The dependencies vector
itself is not vulnerable in this regard, because there's one vector per
file, and we're accessing exactly one ParseCacheT::FileHandleT per thread.

Fixes: #21136
2020-09-09 12:51:28 +02:00
Kitware Robot 9a0a5f8420 CMake Nightly Date Stamp 2020-09-09 00:01:18 -04:00
Brad King 8ec7edf563 Merge topic 'ExternalData-doc-typo'
1ad991a13e Help: correct typo in ExternalData (duplicate "of")

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5196
2020-09-08 15:45:41 -04:00
Brad King 45fedf0e17 Makefile: Add policy CMP0113 to avoid duplication of custom commands
Do not attach a custom command to a target if it is already attached to one of
the target's dependencies.  The command's output will be available by the time
the target needs it because the dependency containing the command will have
already been built.

This may break existing projects that do not properly mark non-created
outputs with the `SYMBOLIC` property.  Previously a chain of two custom
commands whose intermediate dependency is not created would put both
commands in a dependent project's Makefile even if the first command is
also in its dependency's Makefile.  The first command would run twice
but the build would work.  Now the second command needs an explicit
`SYMBOLIC` mark on its input to tell CMake that it is not expected to
exist.  To maintain compatibility with projects that left out the mark,
add a policy activating the behavior.
2020-09-08 15:38:40 -04:00
Brad King 844779bdc1 cmMakefileTargetGenerator: Simplify custom command output collection 2020-09-08 15:38:40 -04:00
Brad King b1b345c21a Merge topic 'ispc_tests_run_on_older_hw'
c83711d9bd ISPC tests will now run on any hardware that only supports SSE2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5205
2020-09-08 15:11:52 -04:00
Brad King 066f4d0f0a VS: Avoid unnecessary duplication of custom commands across targets in VS 9
Do not attach a custom command to a target if it is already attached to one of
the target's dependencies.  The command's output will be available by the time
the target needs it because the dependency containing the command will have
already been built.

The same change was already made by commit f59c33a763 (VS: Generate a
custom command only in the least dependent target, 2018-03-23,
v3.12.0-rc1~171^2) for VS 10+.
2020-09-08 14:52:22 -04:00
Brad King 8bb5c96bf8 cmLocalVisualStudio7Generator: Adopt SourcesVisited lookup table
Move it up the hierarchy from `cmLocalVisualStudio10Generator`.
Propagate contents from a target's dependencies as part of the main
target iteration logic instead of as part of the generator-specific
target generation.
2020-09-08 14:52:22 -04:00
Robert Maynard c83711d9bd ISPC tests will now run on any hardware that only supports SSE2
Previously we expected AVX1 support.
2020-09-08 14:51:56 -04:00
Marc Chevrier be36266dab file(): Add REAL_PATH sub-command 2020-09-08 18:33:57 +02:00
vvs31415 a46fdda464 cmGeneratorTarget: Avoid missing nullptr check
Revise logic in `ComputeOutputDir` that was previously missing
a check for nullptr before constructing a `std::string`.

Fixes: #21165
2020-09-08 12:20:28 -04:00
vvs31415 dae5fe8b8f cmConditionEvaluator: More use of cmProp 2020-09-08 12:19:34 -04:00
Brad King 503d0f80e1 Merge topic 'generate-target-order'
aea465793e cmLocalVisualStudio7Generator: Consolidate target iteration
1527242745 cmLocalVisualStudio10Generator: Simplify target ordering by dependencies
48bf7192e7 cmLocalVisualStudio7Generator: Generate targets in dependency order
17aba9c9a6 cmLocalUnixMakefileGenerator3: Generate targets in dependency order
69ee18163b cmLocalGhsMultiGenerator: Generate targets in dependency order
c4e296a609 cmGlobalGenerator: Compute a global target ordering respecting dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5187
2020-09-08 11:25:17 -04:00
Brad King d0ccc7cf2a Merge topic 'ispc_improvements'
a020787a9b ISPC: Support generation for multiple instruction sets
5a1750017e ISPC: Add compiler launcher support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5173
2020-09-08 11:19:28 -04:00
Brad King b63f508e4d Merge topic 'GetExecutionListFile-by-ref'
879bd7fd9c cmStateSnapshot: Return const reference from GetExecutionListFile()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5186
2020-09-08 11:18:28 -04:00