Commit Graph

64155 Commits

Author SHA1 Message Date
Moritz Haase
0767016eab GoogleTest: Avoid silent failures of dynamic test discovery
The internal helper variable '_GOOGLETEST_DISCOVER_TESTS_SCRIPT' can have gone
out-of-scope when 'gtest_discover_tests()' is called, depending on where the
GoogleTest module is actually included. This leads to a silent failure of
dynamic test discovery, since the custom post-build commands actually does
nothing (it basically invokes 'cmake -P ""'). Ctest will then fail to run the
tests, considering them to be 'not built'.

Fix this by determining the path to the GoogleTest module based on
'${CMAKE_ROOT}' instead, which is always available.

A new test case was added to test suite 'RunCMake/GoogleTest' to ensure that
'gtest_discover_tests()' works correctly when invoked in a different variable
scope.

Fixes: #25477
2023-12-06 12:52:18 +01:00
Kitware Robot
98cbe24918 CMake Nightly Date Stamp 2023-12-06 00:01:13 -05:00
Brad King
57b94595a3 Merge branch 'release-3.28' 2023-12-05 09:29:45 -05:00
Brad King
0e7ef08e10 Merge topic 'RH-gcc-toolset-10-bug-check'
40af103402 cmCMakePath: do not use std::filesystem::path with RH gcc-toolset-10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9026
2023-12-05 09:29:45 -05:00
Brad King
3e8f021137 Merge topic 'RH-gcc-toolset-10-bug-check' into release-3.28
40af103402 cmCMakePath: do not use std::filesystem::path with RH gcc-toolset-10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9026
2023-12-05 09:29:44 -05:00
Brad King
21e30404cd Merge topic 'fix-doc-add_library-INTERFACE-EXCLUDE_FROM_ALL'
7fc6d7247a Help: Fix signature of add_library(<name> INTERFACE EXCLUDE_FROM_ALL)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9031
2023-12-05 09:26:52 -05:00
Brad King
cfd25cb91f Merge branch 'release-3.28' 2023-12-05 09:25:52 -05:00
Brad King
e05cd2871d Merge topic 'cxxmodules-pch'
40dc13b242 cmNinjaTargetGenerator: PCH files do not need dyndep
f61c64cd1c cmLocalGenerator: prevent scanning of PCH source files
ea8c37b759 Tests/CXXModules: add a test which scans a PCH-using source

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9032
2023-12-05 09:25:51 -05:00
Brad King
d301276bf5 Merge topic 'cxxmodules-pch' into release-3.28
40dc13b242 cmNinjaTargetGenerator: PCH files do not need dyndep
f61c64cd1c cmLocalGenerator: prevent scanning of PCH source files
ea8c37b759 Tests/CXXModules: add a test which scans a PCH-using source

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9032
2023-12-05 09:25:50 -05:00
Brad King
b709c42312 Merge branch 'release-3.28' 2023-12-05 09:23:50 -05:00
Brad King
d101cb07ec Merge topic 'cmFileCopier-error-loss'
a820877d03 errors: avoid constructing a stream before getting the last error
5cf7018af6 cmFileCopier: remember error statuses and get their strings
0639a32d3a cmFileTimes: return status codes from APIs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9023
2023-12-05 09:23:49 -05:00
Brad King
8c1da0b4bf Merge topic 'cmFileCopier-error-loss' into release-3.28
a820877d03 errors: avoid constructing a stream before getting the last error
5cf7018af6 cmFileCopier: remember error statuses and get their strings
0639a32d3a cmFileTimes: return status codes from APIs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9023
2023-12-05 09:23:48 -05:00
Brad King
4139486a4f Merge branch 'release-3.28' 2023-12-05 09:22:42 -05:00
Brad King
0ab6a1e9d1 Merge topic 'fix-include-windows'
696e14d977 cmFileLockResult: Fix inclusion of windows.h when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9035
2023-12-05 09:22:42 -05:00
Brad King
dc7bcf55da Merge topic 'fix-include-windows' into release-3.28
696e14d977 cmFileLockResult: Fix inclusion of windows.h when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9035
2023-12-05 09:22:41 -05:00
Brad King
50938b42f9 Merge branch 'release-3.28' 2023-12-05 09:21:12 -05:00
Brad King
f580271c02 Merge topic 'execute_process-no-extension'
fc6231bee5 libuv: win/spawn: run executables with no file extension
b37d9378de libuv: Revert "win/spawn: run executables with no file extension"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !9033
2023-12-05 09:21:12 -05:00
Brad King
dae56e9b58 Merge topic 'execute_process-no-extension' into release-3.28
fc6231bee5 libuv: win/spawn: run executables with no file extension
b37d9378de libuv: Revert "win/spawn: run executables with no file extension"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !9033
2023-12-05 09:21:11 -05:00
Kitware Robot
60fa02de1c CMake Nightly Date Stamp 2023-12-05 00:01:14 -05:00
Brad King
696e14d977 cmFileLockResult: Fix inclusion of windows.h when cross-compiling
In commit 64821d8a26 (cmFileLockResult: Remove expensive windows.h
include, 2023-06-16, v3.28.0-rc1~446^2~13) we accidentally capitalized
the name of the header.  This matters when cross-compiling from a host
with a case-sensitive filesystem.

Fixes: #25474
2023-12-04 16:52:24 -05:00
Kyle Edwards
fc6231bee5 libuv: win/spawn: run executables with no file extension
Backport this commit from libuv PR 4241 to restore `execute_process()`
support for running executables on Windows with no file extension.

Fixes: #25450
2023-12-04 14:50:06 -05:00
Brad King
b37d9378de libuv: Revert "win/spawn: run executables with no file extension"
This reverts commit da9df7425a (libuv: win/spawn: run executables with
no file extension, 2023-11-29, v3.28.0-rc6~1^2~1).  It incorrectly
searched the `PATH` for extension-less command names.  Another fix will
be needed for the regression motivating it.

Record this as a merge from the last-imported upstream libuv snapshot
branch so that future `git blame` points to the upstream for the
original code instead of this commit.

Fixes: #25473
Issue: #25450
2023-12-04 14:48:46 -05:00
Marc Chevrier
40af103402 cmCMakePath: do not use std::filesystem::path with RH gcc-toolset-10
Fixes: #25458, #25453
2023-12-04 17:39:06 +01:00
namniav
7fc6d7247a Help: Fix signature of add_library(<name> INTERFACE EXCLUDE_FROM_ALL)
This signature was added by commit 4391913133 (Add INTERFACE libraries
to generated buildsystem if they have SOURCES, 2020-07-20,
v3.19.0-rc1~346^2~1) with incorrect documentation.

Previously the documented signature as:

    add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL])

which is incorrect.  CMake would recognize `EXCLUDE_FROM_ALL` as a source
file and report an error that it doesn't exists.

The correct signature is:

    add_library(<name> INTERFACE [EXCLUDE_FROM_ALL] [<source>...])

which places `EXCLUDE_FROM_ALL` in the same position used by the
documentation of other signatures.

Fixes: #25463
2023-12-04 10:37:01 -05:00
Brad King
ef89ad6c55 Merge topic 'ctest-jobserver-client'
80fe56c481 ctest: Add support for running under a make job server on POSIX systems
5396f4a9a3 cmUVJobServerClient: Add libuv-based job server integration client

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9021
2023-12-04 09:47:25 -05:00
Brad King
9cb1471ff6 Merge topic 'fileapi-exe-launcher'
80a64c9ce5 fileapi: Add cross-compiling emulator to codemodel-v2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8964
2023-12-04 09:43:05 -05:00
Brad King
b79d2f6f15 Merge topic 'update-librhash'
6a5a9278fa librhash: Update build within CMake for rhash 1.4.4
54eafb156f librhash: aligned_alloc is not available with IBM XLClang on Linux
838bdb4b37 librhash: aligned_alloc is not available on Solaris
33e9e3438c librhash: Remove source fragments not needed for CMake
15bb13bc51 Merge branch 'upstream-librhash' into update-librhash
71d86c4e98 librhash 2023-07-14 (cfe77846)
1fb7ebeb4d librhash: Update import script to get rhash 1.4.4

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9012
2023-12-04 09:41:44 -05:00
Brad King
4b13f8866d Merge topic 'cmake-non-writable-build-dir'
0fd64345fe Tests: Add case covering non-writable CMAKE_BINARY_DIR
d91c02e40f Tests: Factor out RunCMake helper to get UNIX user id
5799d0e788 cmake: Improve error message if CMAKE_BINARY_DIR not writable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8970
2023-12-04 09:40:20 -05:00
Brad King
593b929760 Merge branch 'release-3.28' 2023-12-04 09:38:56 -05:00
Brad King
b629dc3861 Merge topic 'libuv-win-no-default-current-directory'
ab561b86fb libuv: win: honor NoDefaultCurrentDirectoryInExePath env var

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9022
2023-12-04 09:38:55 -05:00
Brad King
b9970be9bc Merge topic 'libuv-win-no-default-current-directory' into release-3.28
ab561b86fb libuv: win: honor NoDefaultCurrentDirectoryInExePath env var

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9022
2023-12-04 09:38:54 -05:00
Ben Boeckel
40dc13b242 cmNinjaTargetGenerator: PCH files do not need dyndep
Fixes: #24209
2023-12-04 08:43:45 -05:00
Ben Boeckel
f61c64cd1c cmLocalGenerator: prevent scanning of PCH source files 2023-12-04 08:43:45 -05:00
Ben Boeckel
ea8c37b759 Tests/CXXModules: add a test which scans a PCH-using source
This tests that PCH usage works with scanning logic.
2023-12-04 07:20:36 -05:00
Kitware Robot
f72ffe9f7f CMake Nightly Date Stamp 2023-12-04 00:01:36 -05:00
Brad King
80fe56c481 ctest: Add support for running under a make job server on POSIX systems
Share job slots with the job server by acquiring a token before running
each test, and releasing the token when the test finishes.
2023-12-03 08:30:07 -05:00
Brad King
5396f4a9a3 cmUVJobServerClient: Add libuv-based job server integration client 2023-12-03 08:30:06 -05:00
Brad King
714a946781 Merge topic 'uv-handle-bool'
47fbb29ad7 cmUVHandlePtr: Fix conversion to bool on Oracle Studio compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9024
2023-12-03 08:29:20 -05:00
Kitware Robot
02c63208d8 CMake Nightly Date Stamp 2023-12-03 00:01:09 -05:00
Brad King
47fbb29ad7 cmUVHandlePtr: Fix conversion to bool on Oracle Studio compiler
The operator added by commit 17690558c3 (cmUVHandlePtr: Add explicit
conversion to bool, 2023-10-26) works in direct expressions like
`if(foo)` but not compound expressions like `if(foo && ...)`.
Drop the `explicit` mark when compiling with Oracle Studio so we
can at least compile valid code.
2023-12-02 06:37:40 -05:00
Kitware Robot
c01cadc664 CMake Nightly Date Stamp 2023-12-02 00:01:10 -05:00
Ben Boeckel
a820877d03 errors: avoid constructing a stream before getting the last error
Constructing a stream may involve operations that change the global
error state. Avoid the streams by using `cmStrCat` instead.
2023-12-01 22:58:05 -05:00
Ben Boeckel
5cf7018af6 cmFileCopier: remember error statuses and get their strings
The last error may have changed between the original call and the
`GetLastSystemError()` call. Remember the status explicitly and ask it
for its error string.

Reported on Discourse: https://discourse.cmake.org/t/9539
2023-12-01 22:58:05 -05:00
Ben Boeckel
0639a32d3a cmFileTimes: return status codes from APIs
This avoids accidentally overwriting the global error state before
fetching the intended error code.
2023-12-01 22:58:05 -05:00
Ralf Habacker
80a64c9ce5 fileapi: Add cross-compiling emulator to codemodel-v2
Fixes: #25408
2023-12-01 10:57:15 -05:00
Brad King
6a5a9278fa librhash: Update build within CMake for rhash 1.4.4 2023-12-01 10:10:51 -05:00
Brad King
54eafb156f librhash: aligned_alloc is not available with IBM XLClang on Linux
The declaration exists in `<stdlib.h>` but the compiler warns about
its allocation alignment attribute.
2023-12-01 10:09:54 -05:00
Kyle Edwards
ab561b86fb libuv: win: honor NoDefaultCurrentDirectoryInExePath env var
Backport commit 5e302730cd (win: honor NoDefaultCurrentDirectoryInExePath
env var, 2023-12-01) from libuv PR 4238.
2023-12-01 09:31:13 -05:00
Brad King
0e11e24ecd Merge topic 'FindPerl-doc'
aca215fbe0 FindPerl: Fix documentation word order
dc3f264f9d FindPerl: Improve documentation formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9020
2023-12-01 09:07:10 -05:00
Brad King
ce0835beee Merge topic 'adsp-on-linux'
33e6862cbc ADSP: Allow progress with CMAKE_ADSP_ROOT unset
85e25451af ADSP: Add /opt/analog/cces to  _find_adsp_root()'s search space
04d8a39e5c ADSP: Use find_program() to get path to cc21k/ccblkfn
7883178cae ADSP: Use $CMAKE_EXECUTABLE_SUFFIX in COMPILER_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9016
2023-12-01 09:05:55 -05:00