Commit Graph

10997 Commits

Author SHA1 Message Date
Brad King
666d2e6451 Merge topic 'restore-pch-with-unity'
30829da506 Unity: Clarify source comments on unity build transformation
87bf1c6c33 Merge branch 'unity-after-compile-features' into restore-pch-with-unity
df08c37a42 cmGlobalGenerator: Add unity/pch sources after computing compile features
004c3c3986 Tests: Add case covering PCH in a unity build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !9215
2024-02-05 09:57:19 -05:00
Brad King
cc0c31e79f Merge topic 'GoogleTest-test-launcher'
f875c479f5 GoogleTest: Honor TEST_LAUNCHER in gtest_discover_tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9174
2024-02-02 10:57:55 -05:00
Brad King
1bbec7927d Merge topic 'update-curl'
01a9325027 Tests: Match curl 8.6.0 error in RunCMake.ctest_submit FailDrop-https case
e28ea90c1b Merge branch 'upstream-curl' into update-curl
851cc904a0 curl 2024-01-31 (5ce164e0)
692463d271 curl: Update script to get curl 8.6.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9207
2024-02-02 10:41:04 -05:00
Brad King
87bf1c6c33 Merge branch 'unity-after-compile-features' into restore-pch-with-unity
Replace commit 76b5383123 (cmGlobalGenerator: add unity sources after
computing target compile features, 2024-01-01, v3.28.2~17^2~1) with an
alternative change.  This merge commit resolves conflicts such that
future `git blame` calls will follow the second parent for the relevant
lines and pretend the replaced commit never existed.

Fixes: #25650
2024-02-02 09:43:15 -05:00
Brad King
004c3c3986 Tests: Add case covering PCH in a unity build
Issue: #25650
2024-02-02 08:14:21 -05:00
Brad King
58d424bca1 Merge topic 'add_custom_command-target-alias'
3b07ec631d add_custom_command: Allow adding build event via ALIAS target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9201
2024-02-01 08:32:20 -05:00
Chen Linxuan
3b07ec631d add_custom_command: Allow adding build event via ALIAS target
Signed-off-by: Chen Linxuan <me@black-desk.cn>
2024-02-01 08:21:41 -05:00
Brad King
01a9325027 Tests: Match curl 8.6.0 error in RunCMake.ctest_submit FailDrop-https case 2024-02-01 08:09:21 -05:00
Brad King
8dd9554d24 Tests: Enable Fortran part of CompileOptions test on single-config generators 2024-01-31 14:51:56 -05:00
Brad King
0a5d29159e Tests: Add "Fortran" test label
With this, `ctest -L Fortran` will run only tests covering Fortran.
2024-01-31 11:27:53 -05:00
Brad King
16b1f0c3e9 Merge topic 'env-cmake-install-prefix'
06af18b9db cmake: Allow CMAKE_INSTALL_PREFIX to be set by environment variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9200
2024-01-31 09:03:21 -05:00
Brad King
2a00813842 Merge topic 'xcode-pch-swift-cxx'
77c4d2f9a2 Xcode: Fix PCH support with Swift & C++

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9203
2024-01-31 09:01:45 -05:00
Ralf Habacker
f875c479f5 GoogleTest: Honor TEST_LAUNCHER in gtest_discover_tests
We run test executables to discover tests.  Use the same launchers that
are used to run the tests.  We already handle `CROSSCOMPILING_EMULATOR`.
Update the logic to account for the `TEST_LAUNCHER` property added by
commit 1ec0372ed4 (add_test: Optionally use a launcher for tests running
in-project targets, 2023-11-11), and for the `CROSSCOMPILING_EMULATOR`
behavior change in commit ca5a300d7f (add_test: Honor
CROSSCOMPILING_EMULATOR only when cross-compiling, 2023-11-02).

Fixes: #25603
Co-authored-by: Brad King <brad.king@kitware.com>
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2024-01-31 08:33:15 -05:00
Mikko Lehtonen
77c4d2f9a2 Xcode: Fix PCH support with Swift & C++
Previously, when a mixed language target ends up with `Swift` as the
`LINKER_LANGUAGE`, the PCH file was not set for the target at all.

Fixes: #21224
2024-01-30 12:50:40 -05:00
Silvio Traversaro
06af18b9db cmake: Allow CMAKE_INSTALL_PREFIX to be set by environment variable
Fixes: #25023
2024-01-30 11:44:45 -05:00
Brad King
03206842ff Merge topic 'test-define-prop'
6c3311d53b Help: Document property redefinition semantics
7aacae4e0e Tests: Add unit tests for property redefinition

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9136
2024-01-30 11:31:10 -05:00
Brad King
622a498477 Merge topic 'test-launcher-emulator-genex'
13ece67a58 Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATOR
b9ad73fcb2 cmTestGenerator: De-duplicate TEST_LAUNCHER and CROSSCOMPILING_EMULATOR impl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9198
2024-01-29 10:50:34 -05:00
Brad King
28e89baa22 Merge topic 'autogen-makefile-depfile'
d0bedb2170 Autogen: Forward dependencies when both Makefile and DEPFILE are used
4deb9c41b8 cmQtAutoGenInitializer: Improve Const-correctness

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9190
2024-01-29 10:43:45 -05:00
Brad King
d377ccbf67 Merge topic 'productbuild-domains-policy'
339ae33e55 CPack: Change CPACK_PRODUCTBUILD_DOMAINS default to true (CMP0161)
4e7f2397e4 CPack: Clear temporary variable after it is no longer needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9197
2024-01-29 10:36:22 -05:00
Brad King
13ece67a58 Add genex support to TEST_LAUNCHER and CROSSCOMPILING_EMULATOR
Evaluate generator expressions in these properties, as they apply to
`add_test`, `add_custom_command`, and `add_custom_target`.

The `CMAKE_CROSSCOMPILING_EMULATOR` variable's `try_run` behavior occurs
at configure time and so cannot support generator expressions.
2024-01-29 10:30:24 -05:00
FeRD (Frank Dana)
7aacae4e0e Tests: Add unit tests for property redefinition
From reading `Source/cmDefinePropertyCommand.cxx` and
`Source/cmPropertyDefinition.cxx`, attempts to use `define_property()`
to redefine an existing property will be silently ignored.
Once a property is defined, it cannot be redefined.

Add some unit tests to confirm this behavior of `define_property()`
remains as expected based on the current implementation.
2024-01-29 05:23:37 -05:00
Brad King
f434d650ee Merge topic 'test-launcher-emulator'
fb766ff638 Tests: Improve RunCMake.add_test TEST_LAUNCHER coverage
c5b58b0842 Tests: Improve RunCMake.add_test error formatting
b440e0af3f Tests: Improve RunCMake.CrosscompilingEmulator coverage
54edf3471e Tests: Improve RunCMake.CrosscompilingEmulator error formatting
2b5447d4a8 Tests: Shorten RunCMake.CrosscompilingEmulator executable names
10f906106e Tests: Teach pseudo_emulator helper to pass by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9192
2024-01-28 09:49:08 -05:00
Orkun Tokdemir
d0bedb2170 Autogen: Forward dependencies when both Makefile and DEPFILE are used
Since commit ebc9e448b3 (Autogen: Add depfile support for Makefiles,
2023-09-07, v3.28.0-rc1~101^2~1) CMake does not generate the correct
dependency graph when both `Makefile` and `DEPFILE` are used.
The build of `<target_name>_autogen_timestamp_deps` fails due to
missing dependencies.  To tackle that problem, forward target
dependencies to both `<target_name>_autogen_timestamp_deps` and
`<target_name>_autogen` instead of just `<target_name>_autogen`.

Fixes: #25600
2024-01-28 09:40:47 -05:00
Craig Scott
339ae33e55 CPack: Change CPACK_PRODUCTBUILD_DOMAINS default to true (CMP0161)
Fixes: #23351
2024-01-28 21:09:12 +11:00
Brad King
fb766ff638 Tests: Improve RunCMake.add_test TEST_LAUNCHER coverage
Verify that ctest actually runs the test command lines as expected.
2024-01-27 11:34:35 -05:00
Brad King
c5b58b0842 Tests: Improve RunCMake.add_test error formatting 2024-01-27 11:34:35 -05:00
Brad King
b440e0af3f Tests: Improve RunCMake.CrosscompilingEmulator coverage
Verify that ctest actually runs the test command lines as expected.
2024-01-27 11:34:35 -05:00
Brad King
54edf3471e Tests: Improve RunCMake.CrosscompilingEmulator error formatting 2024-01-27 10:01:18 -05:00
Brad King
2b5447d4a8 Tests: Shorten RunCMake.CrosscompilingEmulator executable names
Also switch to pure C.
2024-01-27 09:57:48 -05:00
Brad King
10f906106e Tests: Teach pseudo_emulator helper to pass by default 2024-01-27 09:50:43 -05:00
Brad King
d9b9f63083 Merge topic 'ctest-tests-from-file'
701029726f ctest_test: add options INCLUDE_FROM_FILE and EXCLUDE_FROM_FILE
dbacc1d5a8 ctest: add command line option to exclude tests listed in a given file
022f20f663 ctest: add command line option to run the tests listed in a given file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !9128
2024-01-26 10:14:58 -05:00
Florian Weimer
a10d2ad397 Tests: Improve C compatibility of LoadCommand tests
The previous code used `char **` and `const char **`` types as if they
were the same.  But they are distinct types in C, so when passing
these pointers as function arguments, their types have to match.
Future C compilers will treat this as an error, similar to what
C++ compilers do today.
2024-01-25 14:35:01 -05:00
Alex Neundorf
701029726f ctest_test: add options INCLUDE_FROM_FILE and EXCLUDE_FROM_FILE
These options can be used to specify files which can be used
to restrict the set of tests that will be executed.

Fixes: #25455
2024-01-25 12:38:04 -05:00
Alex Neundorf
dbacc1d5a8 ctest: add command line option to exclude tests listed in a given file
Add `--exclude-from-file <filename>` to exclude the tests listed in the
given file.

Issue: #25455
2024-01-25 12:37:56 -05:00
Alex Neundorf
022f20f663 ctest: add command line option to run the tests listed in a given file
Add `--tests-from-file <filename>` to run only the tests listed in the
given file.  The test names must match exactly, no regexps or something.
The listed tests can still be filtered with a regexp using -R.

Issue: #25455
2024-01-25 12:37:16 -05:00
Brad King
b11c8c45f9 Merge topic 'cmuvprocesschain'
adb3e13d32 cmUVProcessChain: Tolerate fileno() of invalid FILE stream
b6e4e4babc cmUVProcessChain: Simplify SetExternalStream usage
116bb2b70f cmUVProcessChain: Simplify builder initialization
d32c30906a Tests: Add missing include in testUVProcessChainHelper on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9181
2024-01-25 10:40:02 -05:00
Brad King
35246ed9c4 Merge topic 'swift-windows'
b2129a14f4 Tests: Fix SwiftMix tests' runtime library selection on Windows
4f49f7fc0b Tests: Fix SwiftOnly test on Windows
2dec0c0308 Tests: Fix RunCMake.Swift expected output on Windows
79f1f509b1 Tests: Fix RunCMake.Swift's build output checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jeremy Day <jadaytime@gmail.com>
Merge-request: !9169
2024-01-25 10:15:28 -05:00
Brad King
b6e4e4babc cmUVProcessChain: Simplify SetExternalStream usage
It is commonly called with the `fileno()` of a `FILE*` stream,
so accept the latter directly.
2024-01-24 16:59:49 -05:00
Brad King
d32c30906a Tests: Add missing include in testUVProcessChainHelper on Windows
We use `STATUS_ACCESS_VIOLATION` from `windows.h`.
2024-01-24 16:59:23 -05:00
Brad King
b2129a14f4 Tests: Fix SwiftMix tests' runtime library selection on Windows
Swift on Windows provides only a release runtime.
Use it for C and CXX too, in all configurations, to match.

Issue: #25573
Suggested-by: Saleem Abdulrasool <compnerd@compnerd.org>
2024-01-24 14:44:40 -05:00
Evan Wilde
4f49f7fc0b Tests: Fix SwiftOnly test on Windows
Add public symbols to SubA and SubB.  The test was broken due to a
broken build graph.  The build graph expects libraries to emit the
`.lib` file.  `link.exe` only emits the implib if the library exports at
least one symbol. Because these two libraries were empty, nothing was
generated.

Fixing by adding a public symbol to both libraries.

Issue: #25573
2024-01-24 14:43:21 -05:00
Evan Wilde
2dec0c0308 Tests: Fix RunCMake.Swift expected output on Windows
Artifact file extensions differ.

Issue: #25573
2024-01-24 14:42:52 -05:00
Brad King
79f1f509b1 Tests: Fix RunCMake.Swift's build output checks 2024-01-24 14:41:35 -05:00
Brad King
73b76563fb Merge topic 'validate_read-only_target_properties'
0cfd8fe8ad cmTarget: Don't allow setting read-only properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9133
2024-01-24 08:39:09 -05:00
Brad King
4571ce5f1a Merge topic 'cuda-clang-windows'
88c740462c CUDA/Clang: Add support for MSVC ABI on Windows using GNU-like frontend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !9172
2024-01-23 14:56:16 -05:00
Robert Maynard
0cfd8fe8ad cmTarget: Don't allow setting read-only properties
Ensure that all documented read-only target properties now produce
errors when trying to set.
2024-01-23 08:50:38 -05:00
Brad King
88c740462c CUDA/Clang: Add support for MSVC ABI on Windows using GNU-like frontend
Fixes: #20776
2024-01-22 09:33:54 -05:00
Brad King
c6efbd78d8 MSVC: Teach find_library to consider the 'libfoo.a' naming convention
When targeting the GNU ABI, we consider `.a` libraries first but also
accept `.lib`.  For symmetry, when targeting the MSVC ABI, we now
consider `.lib` first but also accept `.a`.

This adds support for meson-generated static libraries, which are named
with the pattern `lib${foo}.a`:

* https://mesonbuild.com/FAQ.html#why-does-building-my-project-with-msvc-output-static-libraries-called-libfooa

Note that this was previously attempted by

* commit be848a71b0 (MSVC: Teach find_library to consider the 'libfoo.a'
                     naming convention, 2022-09-19, v3.25.0-rc1~111^2)

but was reverted by

* commit 955d6245c1 (MSVC: Revert "Teach find_library to consider the
                     'libfoo.a' naming convention", 2022-11-28, v3.25.1~6^2)

due to problems finding GNU ABI libraries in PATH-derived prefixes.
Since then,

* commit 0a81110b84 (find_(library|file|path): Drop PATH-derived search
                     prefixes, 2023-09-14, v3.28.0-rc1~91^2)

removed the problematic search paths, so we can restore this change.

Fixes: #23975
2024-01-19 17:12:36 -05:00
Brad King
62ca95518e Merge topic 'cuda-test-cleanup'
607d271b1f Tests: Do not expect nvToolsExt in CUDA 12 toolkit
5eb26fb943 Tests: Fix CudaOnly.Toolkit coverage of npp libs
af85fa7ac1 Tests: Remove unused dllexport markup from CudaOnly.DeviceLTO
d40bca5a8c Tests: Remove unused iostream from CUDA sources
a9bb2606c1 Tests: Fix condition adding nvcc-only flags in CudaOnly.SeparateCompilation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9167
2024-01-19 11:42:49 -05:00
Brad King
4cd153afe3 Merge branch 'backport-cxxmodules-export-file-collisions' 2024-01-18 17:45:07 -05:00