Commit Graph

8696 Commits

Author SHA1 Message Date
Zack Galbreath
cbcb92d1cb ctest: add support for attaching files to tests at run time
Allow tests to specify files to upload at runtime. Previously this was
only possible to specify at configure time with the ATTACHED_FILES
test properties.

This commit also fixes a bug in how our test data tarballs were generated
by CTest. Previously, if you tried to attach a file outside of the binary
directory, CTest would generate a tar file with a relative path, and tar
would not allow you to extract it. We resolve this problem by creating
tar files with a flat directory structure instead.

Fixes: #22284
2021-06-08 09:27:19 -04:00
Brad King
acb25d50d9 Merge topic 'install-with-runtime-dependencies'
8d898cb3e1 FileAPI: Add integration for runtime dependency installers
72f2448e82 Help: Add documentation for runtime dependency installation
0c3c6acaff Tests: Add tests for new options
4910132d8c install: Add RUNTIME_DEPENDENCY_SET mode
bc8a4a06a4 install(IMPORTED_RUNTIME_ARTIFACTS): Add RUNTIME_DEPENDENCY_SET option
3e7d3c252a install(TARGETS): Add RUNTIME_DEPENDENCY_SET argument
ed3633d88c install(TARGETS): Add RUNTIME_DEPENDENCIES option
f2617cf8e6 Source: Add cmInstallRuntimeDependencySet
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6186
2021-06-08 08:09:04 -04:00
Brad King
d1517a4ef9 Merge topic 'compile-options-order'
8f68bcad8f Tests: Add cases verifying flag ordering rules
ccc83ce162 Help: Document order of flags from CMAKE_<LANG>_FLAGS and COMPILE_OPTIONS
df79fe055b Help: Remove incorrect "versionadded" for CMAKE_<LANG>_FLAGS_<CONFIG>
c48d2d8480 VS: Place per-source preprocessor definitions after target-wide ones

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6187
2021-06-08 08:04:16 -04:00
Sam Freed
de2b14a711 Merge branch 'backport-3.20-presets-build-fixes' into presets-build-fixes 2021-06-08 07:49:50 -04:00
Sam Freed
534c40e6d8 presets: Fix buildPreset "targets" not allowing a single string
Fixes: #22272
2021-06-08 07:47:54 -04:00
Brad King
93e396b402 presets: Fix buildPreset "jobs" field test case
Avoid passing parallel build options to Make tools that do not support
them.
2021-06-08 07:47:20 -04:00
Zack Galbreath
8514ee9b31 HIP: analyze output of hipcc to determine default GPU architecture 2021-06-07 19:25:34 +00:00
Robert Maynard
20d086f1a2 HIP: All HIP tests now run on CMake's current AMD hardware 2021-06-07 19:25:33 +00:00
Robert Maynard
2e86e50c2f HIP: Add HIP to all the Check* modules 2021-06-07 19:25:33 +00:00
Robert Maynard
947dbed0aa HIP: Automatically inject the hip::device runtime target
Any target that might need to link to hip code needs the `hip::device`
target
2021-06-07 19:25:33 +00:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Sam Freed
efe7ac9022 presets: Fix buildPreset "targets" not allowing a single string
Fixes: #22272
2021-06-07 13:56:44 -04:00
Brad King
8f68bcad8f Tests: Add cases verifying flag ordering rules 2021-06-07 13:39:21 -04:00
Kyle Edwards
8d898cb3e1 FileAPI: Add integration for runtime dependency installers 2021-06-04 15:25:18 -04:00
Kyle Edwards
0c3c6acaff Tests: Add tests for new options 2021-06-04 10:07:38 -04:00
Kyle Edwards
4910132d8c install: Add RUNTIME_DEPENDENCY_SET mode 2021-06-04 08:52:02 -04:00
Kyle Edwards
bc8a4a06a4 install(IMPORTED_RUNTIME_ARTIFACTS): Add RUNTIME_DEPENDENCY_SET option 2021-06-04 08:52:02 -04:00
Kyle Edwards
3e7d3c252a install(TARGETS): Add RUNTIME_DEPENDENCY_SET argument 2021-06-04 08:52:02 -04:00
Kyle Edwards
ed3633d88c install(TARGETS): Add RUNTIME_DEPENDENCIES option 2021-06-04 08:52:02 -04:00
Kyle Edwards
9f6cfe7169 file: Add undocumented RPATH_SET command 2021-06-04 08:52:01 -04:00
Kyle Edwards
2ef3ea394f file(GET_RUNTIME_DEPENDENCIES): Add undocumented RPATH_PREFIX option 2021-06-04 08:52:01 -04:00
Adam Badura
6f14205e08 FindPkgConfig: Always create the imported target
Fixes: #22180
2021-06-04 08:33:27 -04:00
Brad King
07d6390728 Tests: Add case covering FindPkgConfig creation of empty targets 2021-06-04 08:33:11 -04:00
Brad King
26e75b474b Merge topic 'env-toolchain-file'
6c34ed9b87 cmake: Allow CMAKE_TOOLCHAIN_FILE to be set by environment variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6188
2021-06-04 07:00:43 -04:00
Brad King
c61782917d Merge topic 'implicit-link-static'
1d7fddca8e CMakeParseImplicitLinkInfo: Honor GNU static runtime library flags
629eb3926b Tests: Extend ParseImplicit*Info with static GNU runtime library flags
9d0f8c3e56 Tests: Teach RunCMake.ParseImplicitLinkInfo to match output by regex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6185
2021-06-04 06:59:37 -04:00
Brad King
b6c4d93dcd clang-analyzer: Suppress warnings in intentional use-after-move cases 2021-06-03 14:59:55 -04:00
Brad King
6c34ed9b87 cmake: Allow CMAKE_TOOLCHAIN_FILE to be set by environment variable
When no `CMAKE_TOOLCHAIN_FILE` is explicitly specified while creating
a new build tree, check for an environment variable of the same name.
2021-06-03 08:32:44 -04:00
Brad King
1d7fddca8e CMakeParseImplicitLinkInfo: Honor GNU static runtime library flags
With flags like `-static-libstdc++` or `-static-libgfortran`, the GNU
compiler driver adds `-Bstatic ... -Bdynamic` around its language
runtime library.  Convert the libraries in between these to absolute
paths so that mixed-language linking honors the static runtime
libraries.
2021-06-03 08:12:58 -04:00
Brad King
629eb3926b Tests: Extend ParseImplicit*Info with static GNU runtime library flags
Generate sample input data with GNU 10.2.1 compilers using flags like
`-static-libstdc++` and `-static-libgfortran`.
2021-06-03 08:12:11 -04:00
Brad King
9d0f8c3e56 Tests: Teach RunCMake.ParseImplicitLinkInfo to match output by regex
As in commit 6bc6fc2a7f (Tests: Teach RunCMake.ParseImplicitIncludeInfo
to match output by regex, 2019-04-08, v3.14.2~5^2~1).
2021-06-03 08:12:11 -04:00
Brad King
9c33ff4dda Merge topic 'find_item-NO_CACHE'
87b71eec62 find_*: Add support for option NO_CACHE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6181
2021-06-03 08:11:04 -04:00
Brad King
4297357087 Merge topic 'ctest-coverage-no-dir'
5d5610b04f CTest: Exit coverage handling early if no binary dir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6144
2021-06-03 08:08:42 -04:00
Marc Chevrier
87b71eec62 find_*: Add support for option NO_CACHE
Request that find result is stored in a normal variable rather than a
cache entry.

Fixes: #20687
Issue: #20743
2021-06-02 14:55:00 -04:00
Joseph Snyder
5d5610b04f CTest: Exit coverage handling early if no binary dir
Check for the existence of the Binary directory string before checking
for coverage files.  If the directory is not specified, write an error
message and do not do any checking.

Fixes: #22102
2021-06-02 08:41:09 -04:00
Brad King
f0e9d74a2d cmake_transform_depfile: Remove unused incomplete vstlog support
In commit b2c14bc774 (cmake -E: Add cmake_transform_depfile internal
command, 2020-10-02, v3.20.0-rc1~684^2~2) a partial implementation for
converting MSBuild "TLog" format files was added.  However, it is
unused and incomplete:

* Does not enforce absolute paths as TLog docs require.
* Does not upper-case paths as TLog docs recommend.
* The TLog format semantics are not equivalent to `out: in`.

Remove the unused TLog transform infrastructure to avoid confusion.

Issue: #20286
2021-06-02 07:41:05 -04:00
Brad King
cf470d8dac Merge topic 'command_target'
1cb4f592a0 add_custom_command: Target-dependent generator expression support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6176
2021-06-02 07:39:44 -04:00
Brad King
399a321a64 Merge topic 'get-runtime-dependencies-file-filter'
a12639e658 file(GET_RUNTIME_DEPENDENCIES): Add POST_{IN,EX}CLUDE_FILES arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6170
2021-06-02 07:38:17 -04:00
Kyle Edwards
a12639e658 file(GET_RUNTIME_DEPENDENCIES): Add POST_{IN,EX}CLUDE_FILES arguments 2021-06-01 09:02:33 -04:00
Brad King
02957bb589 Merge topic 'install-imported-runtime-artifacts'
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode
60e752ced8 Refactor: Move common methods into cmInstallGenerator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6162
2021-06-01 08:42:16 -04:00
Brad King
5eb2aa1f57 Merge topic 'link-objects-first'
3941555d93 target_link_libraries: Place $<TARGET_OBJECTS> before libraries
f530b3a267 OpenWatcom: Add infrastructure to link to object files
8a4ca110e4 cmComputeLinkInformation: Improve type safety of item IsPath member
83ad066ed1 cmComputeTargetDepends: Factor out helper to add object library dependency
7f506b95a7 cmGeneratorTarget: Refactor link item lookup
96809a8541 cmGeneratorTarget: Give temporary link impl item an explicit name
ddffbb8adb cmMakefile: Register explicit object sources more efficiently
18e42d3e63 cmGeneratorExpressionNode: Constify local variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6166
2021-06-01 08:35:56 -04:00
Kyle Edwards
f7ba3a0589 FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS 2021-05-31 09:02:45 -04:00
Kyle Edwards
df7040a271 install(): Add IMPORTED_RUNTIME_ARTIFACTS mode 2021-05-31 09:02:45 -04:00
Raul Tambre
1cb4f592a0 add_custom_command: Target-dependent generator expression support
OUTPUT variant with a TARGET given to allow resolving target-based generator
expressions wouldn't work because OUTPUT is resolved before generator targets
are created, i.e. FindGeneratorTargetToUse() returns nullptr.
This is a known limitation, see #21364.

Implements #21336.
2021-05-31 10:39:58 +03:00
Brad King
6da12f2611 Merge topic 'linker-launcher'
ae108418ae Launchers: Support setting linker launchers
92c8b83641 cmNinjaNormalTargetGenerator: Fix "Language" rule variable
d93bfd95f8 Tests/CompilerLauncher: Fix file names and clarify comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6092
2021-05-29 09:48:42 -04:00
Brad King
37cda77d16 Merge topic 'fix-compile-db-crash'
316cbbe8d5 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6173
2021-05-29 09:45:33 -04:00
Brad King
3941555d93 target_link_libraries: Place $<TARGET_OBJECTS> before libraries
Linkers always use object files explicitly specified on the command line
regardless of where they appear.  Move them to the front of the list of
linked libraries in so that symbols required by the object files can be
resolved by any library.

Issue: #22149
2021-05-29 09:28:36 -04:00
Brad King
316cbbe8d5 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule
Extend the fix from commit 67e2130c96 (Makefiles: Fix
CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule,
2020-11-20, v3.19.1~8^2) to work for the `<FLAGS>` placeholder too.
Also fix the test case to actually enable `EXPORT_COMPILE_COMMANDS`
on the test target.

Fixes: #22261
2021-05-28 15:41:38 -04:00
Bobby D Reynolds
ae108418ae Launchers: Support setting linker launchers
Fixes: #18316
2021-05-28 12:28:43 -04:00
Bobby D Reynolds
d93bfd95f8 Tests/CompilerLauncher: Fix file names and clarify comment 2021-05-28 12:28:42 -04:00
Brad King
8f9fa818dc Merge topic 'WriteBasicConfigVersion_support_leading_zeroes'
e609afeb5f WriteBasicConfigVersion supports version strings such as 21.07.04

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6167
2021-05-28 12:22:31 -04:00