Commit Graph

29501 Commits

Author SHA1 Message Date
Brad King
8d5f4c4db9 Xcode: Switch to the "new build system" for Xcode 12 and above
Provide an option to switch back to the original build system via
`-T buildsystem=1`.

Fixes: #18088
2020-09-18 13:02:14 -04:00
Brad King
2db623f554 Xcode: Add option to specify build system variant
Extend the `-T <toolset>` option to support a `buildsystem=` field with
the Xcode generator.  Add a `CMAKE_XCODE_BUILD_SYSTEM` variable to
inform project code about the selected build system variant.
2020-09-18 12:49:17 -04:00
Brad King
3ab18c870d Xcode: Factor out build phase variable declarations 2020-09-18 12:49:17 -04:00
Brad King
0d03717996 Xcode: Clarify name of legacy run script build phase helper 2020-09-18 12:49:17 -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
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
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
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
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
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
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
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
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
Brad King
0bd9640968 Merge topic 'optimize-cmJoin'
38928ee3ee cmStringAlgorithms: Add faster cmJoin overloads for strings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5185
2020-09-08 11:17:29 -04:00
Kyle Edwards
0c9cdf30ed cmStringAlgorithms: Add cmStrLen() 2020-09-08 10:15:54 -04:00
Marc Chevrier
56134c1708 Merge topic 'cmake_path'
eb583b0a66 cmake_path command: path management
212e953d35 cmCMakePath: Class for path handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5158
2020-09-08 08:49:12 -04:00
Kitware Robot
412cc37d35 CMake Nightly Date Stamp 2020-09-08 00:01:14 -04:00
Cristian Adam
ce7c100545 PCH: Fix 30s wait for VS2008 when used via -Tv90
Fixes: #21142
Backport: release
2020-09-07 19:49:15 +02:00
Kyle Edwards
11a0c04472 Merge topic 'fix-compare'
4bc1486cd3 cmConditionEvaluator: Avoid comparing pointers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5189
2020-09-07 12:17:39 -04:00
Kitware Robot
726fe80759 CMake Nightly Date Stamp 2020-09-07 00:01:37 -04:00
Marc Chevrier
eb583b0a66 cmake_path command: path management
Fixes: #19568, #20922
2020-09-06 10:52:25 +02:00
Marc Chevrier
212e953d35 cmCMakePath: Class for path handling 2020-09-06 10:34:17 +02:00
Kitware Robot
46fbb75b21 CMake Nightly Date Stamp 2020-09-06 00:01:08 -04:00
Kitware Robot
1aed7c5d59 CMake Nightly Date Stamp 2020-09-05 00:01:24 -04:00
vvs31415
4bc1486cd3 cmConditionEvaluator: Avoid comparing pointers 2020-09-04 13:39:27 -04:00
Kyle Edwards
6ff33a2011 Merge topic 'use-tocstr'
1380b43764 Refactor: Use cmToCStr()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5184
2020-09-04 11:47:44 -04:00
Brad King
aea465793e cmLocalVisualStudio7Generator: Consolidate target iteration
Combine iteration with `cmLocalVisualStudio10Generator` and dispatch
generation of each target with a virtual `GenerateTarget` method.
2020-09-04 09:44:30 -04:00
Brad King
1527242745 cmLocalVisualStudio10Generator: Simplify target ordering by dependencies
Replace our own depth-first traversal with use of the global generator's
computed target order that respects dependencies.
2020-09-04 09:44:30 -04:00
Brad King
48bf7192e7 cmLocalVisualStudio7Generator: Generate targets in dependency order
Use the globally computed target ordering so that we generate all
of a target's dependencies before generating the target itself.
2020-09-04 09:44:30 -04:00
Brad King
17aba9c9a6 cmLocalUnixMakefileGenerator3: Generate targets in dependency order
Use the globally computed target ordering so that we generate all
of a target's dependencies before generating the target itself.
2020-09-04 09:44:30 -04:00
Brad King
69ee18163b cmLocalGhsMultiGenerator: Generate targets in dependency order
Use the globally computed target ordering so that we generate all
of a target's dependencies before generating the target itself.
2020-09-04 09:44:08 -04:00