Commit Graph

7839 Commits

Author SHA1 Message Date
Brad King 44c5f5d4ec Merge topic 'cmake_path-updates'
82c9508313 cmake_path: enhancements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !5245
2020-09-22 08:03:51 -04:00
Brad King 966c3263c2 Merge topic 'file-ARCHIVE-compression-level'
195d14e781 file(ARCHIVE_CREATE): Add option to control compression level

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !5242
2020-09-22 07:43:31 -04:00
Asit Dhal 195d14e781 file(ARCHIVE_CREATE): Add option to control compression level
Fixes: #21125
2020-09-21 13:08:11 -04:00
Brad King 64901e053b Merge topic 'xcode-12-new-build-system'
b8ecd4df5f ExternalProject: Use CMP0114 NEW behavior with Xcode "new build system"
fe258f6382 Tests: Skip RunCMake.XcodeProject device cases for Xcode "new build system"
1c3d2d0951 Tests: Skip Qt*Autogen.MocSkipSource case for Xcode "new build system"
542884e527 Tests: Update RunCMake.XcodeProject cases for Xcode "new build system"
832a78be2d Tests: Update BuildDepends test for Xcode "new build system"
ff76c51ec3 Tests: Update RunCMake.file case with workaround for Xcode "new build system"
1806cdd17c Tests: Avoid duplicate custom commands for Xcode "new build system"
8d5f4c4db9 Xcode: Switch to the "new build system" for Xcode 12 and above
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5229
2020-09-21 09:10:48 -04:00
Brad King ca5e309940 Merge topic 'foreach-int-parse-range-check'
0412b55b83 foreach: Fix crash parsing integer out of range

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5239
2020-09-21 08:55:29 -04:00
Marc Chevrier 82c9508313 cmake_path: enhancements
* Fix error on parsing "c:a" (root-name without root-directory)
* Enrich documentation
2020-09-20 15:17:34 +02:00
Brad King b8ecd4df5f ExternalProject: Use CMP0114 NEW behavior with Xcode "new build system"
The ExternalProject module cannot be implemented in the Xcode "new build
system" without using CMP0114's NEW behavior.  When configuring for that
build system, warn if the policy is not set to NEW and use NEW behavior
anyway.
2020-09-18 13:46:45 -04:00
Brad King fe258f6382 Tests: Skip RunCMake.XcodeProject device cases for Xcode "new build system"
The Xcode "new build system" selects different architectures for device
builds than the old build system does.  Skip those tests on Xcode 12+
pending further investigation.

Issue: #21206
2020-09-18 13:46:39 -04:00
Brad King 1c3d2d0951 Tests: Skip Qt*Autogen.MocSkipSource case for Xcode "new build system"
This test case enables AUTOMOC on the same sources in two separate targets.
This causes the `moc_*.cpp` generation custom commands to be added to multiple
`_autogen` targets, which is not allowed by the Xcode "new build system".
Skip the part of the test that triggers this problem for now.

Issue: #21205
2020-09-18 13:46:39 -04:00
Brad King 542884e527 Tests: Update RunCMake.XcodeProject cases for Xcode "new build system" 2020-09-18 13:02:20 -04:00
Brad King 832a78be2d Tests: Update BuildDepends test for Xcode "new build system"
Xcode somehow tracks what we're running inside a custom command,
so we cannot prevent it from regenerating the `noregen.h` header
even though we do not declare any dependencies of it.
2020-09-18 13:02:19 -04:00
Brad King ff76c51ec3 Tests: Update RunCMake.file case with workaround for Xcode "new build system" 2020-09-18 13:02:19 -04:00
Brad King 1806cdd17c Tests: Avoid duplicate custom commands for Xcode "new build system" 2020-09-18 13:02:19 -04:00
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 5a15fcf597 Tests: Avoid duplicate custom commands in QtAutogen.AutogenOriginDependsOff 2020-09-18 12:49:09 -04:00
Ben McMorran 0412b55b83 foreach: Fix crash parsing integer out of range 2020-09-18 09:54:58 -04:00
Brad King ce89f54ee3 Merge topic 'rel-drop-old'
6a88e6332f Utilities/Release: Drop now-unused scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5234
2020-09-18 08:43:13 -04:00
Brad King 5d952fd6e2 Merge topic 'ninja-multi-automoc-regression'
23fe4b861f Ninja Multi-Config: Fix dependencies of custom commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5238
2020-09-18 08:42:28 -04:00
Kyle Edwards 23fe4b861f Ninja Multi-Config: Fix dependencies of custom commands
a9fd3a10 addressed the scenario where the depending target is a
utility target, but not the scenario where the dependent target is
a utility target. Account for this scenario.

Also add a Qt-specific test case.

Fixes: #21118
2020-09-17 15:46:57 -04:00
Brad King bb8afa0020 Merge topic 'string-json-support'
8eab76eb84 string(JSON): Adds JSON parsing support to the string command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Merge-request: !5159
2020-09-17 09:47:43 -04:00
Brad King 6a88e6332f Utilities/Release: Drop now-unused scripts
Since these commits:

* commit ab2276e6b9 (Utilities/Release: remove old macOS release script,
                     2020-09-16)
* commit 7670ba8b0a (Utilities/Release: Drop win{32,64} scripts in favor
                     of docker build, 2020-05-05, v3.18.0-rc1~203^2)
* commit 689fdbfc61 (Utilities/Release: Drop linux64 script in favor of
                     docker build, 2019-08-27, v3.16.0-rc1~184^2)

several scripts we once used for producing release binaries for
distribution on `cmake.org` are no longer needed.
2020-09-17 09:11:03 -04:00
Ben Boeckel ab2276e6b9 Utilities/Release: remove old macOS release script
macOS releases are now made by GitLab-CI.
2020-09-16 16:09:01 -04:00
Peter Steneteg 8eab76eb84 string(JSON): Adds JSON parsing support to the string command
Adds a set of sub commands to the string command for parsing JSON, the
JSON commands are: GET, TYPE, MEMBER, LENGTH, REMOVE, SET, and EQUAL.

Closes: #19501
2020-09-16 13:55:24 -04:00
Brad King b7590b8845 Merge topic 'ExternalProject-steps-refinement'
b4fc4da903 ExternalProject: Add policy CMP0114 to refine step target dependencies
f5791e24c6 Tests: Match RunCMake.ExternalProject NO_DEPENDS output more strictly
b637ef494c ExternalProject: Factor out an internal helper to add a step target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5215
2020-09-15 14:38:45 -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 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 acca494801 Merge topic 'test-pch-instantiate-templates'
0512e94eb0 Tests: Fix PchInstantiateTemplates case on macOS with CMAKE_OSX_ARCHITECTURES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5217
2020-09-14 10:20:09 -04:00
Brad King 06c16b8b08 Merge topic 'import-export-doc'
3310801aab Help: Add Importing and Exporting Guide

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Merge-request: !5157
2020-09-14 10:19:23 -04:00
Betsy McPhail 3310801aab Help: Add Importing and Exporting Guide 2020-09-11 08:50:52 -04:00
Brad King 907a3de1c4 Merge topic 'ispc_window_failures'
bf88a94d88 ISPC: CompilerLauncher tests work properly with x86 builds
8de145cae1 ISPC: DynamicLibrary test now passes on windows.
a83521e082 ISPC: Use the `obj` file extension for objects on windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5213
2020-09-11 08:31:13 -04:00
Brad King 0512e94eb0 Tests: Fix PchInstantiateTemplates case on macOS with CMAKE_OSX_ARCHITECTURES
Update the test added by commit 8c8f03422e (PCH: Template instantiation
support, 2020-08-28) to recognize flags on PCH files whose names include
the architecture.  This occurs when `CMAKE_OSX_ARCHITECTURES` is set.
2020-09-11 08:06:20 -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
Robert Maynard bf88a94d88 ISPC: CompilerLauncher tests work properly with x86 builds 2020-09-10 16:15:55 -04:00
Robert Maynard 8de145cae1 ISPC: DynamicLibrary test now passes on windows.
The MSVC linker needs to know what MSVC runtime a shared library
needs. ISPC objects don't have a '/DIRECTIVE' entry for the
MSVC runtime as they have no dependency on it. Therefore
we need to add a C or C++ source to each shared library so
the MSVC linker knows what runtime to embed
2020-09-10 16:15:55 -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
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
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
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
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