Commit Graph

12578 Commits

Author SHA1 Message Date
Ben Boeckel
050f891d81 Tests: choose an explicit FULL strategy in tests expecting it
Since it can be set in the environment when running the test suite,
guard tests which are sensitive to intermediate directory strategy
changes with explicit settings.
2025-07-29 08:06:30 -04:00
John Parent
cce31527f8 Tests/ObjectLibrary: add shortened path tests 2025-07-29 08:06:29 -04:00
John Parent
4d58030b92 Tests/UnityBuild: add shortened path tests 2025-07-29 08:06:29 -04:00
John Parent
526a6f2a81 cmGeneratorTarget: shorten PCH filenames 2025-07-29 08:06:29 -04:00
Ben Boeckel
02b2153d84 cmGlobalGenerator: add a query to represent support for short object names 2025-07-28 12:01:28 -04:00
Ben Boeckel
f928be199c Tests/RunCMake/AutoExport: fix typo in AIX build directory name 2025-07-28 12:01:27 -04:00
Brad King
a69131cd88 Merge topic 'export-refactor'
078b96f927 cmExportCommand: Refactor export(EXPORT ... ) to use subparsers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10965
2025-07-28 11:08:24 -04:00
Taylor Sasser
078b96f927 cmExportCommand: Refactor export(EXPORT ... ) to use subparsers 2025-07-28 09:50:44 -04:00
Craig Scott
aa63990ca9 file API: Add JSON schema files
Fixes: #26987
2025-07-26 18:51:27 +10:00
Brad King
e3f57a60ba Merge topic 'add-subparsers'
aaeffdfe6b cmArgumentParser: Refactor to allow for nested parsers
18f818f556 cmArgumentParser: Move parser state into dedicated struct

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10963
2025-07-24 09:37:23 -04:00
Brad King
558b3922c3 Merge topic 'ExternalProject-env-vars'
e301cbffcc ExternalProject: Set environment variables
ff21c3f78a Help: ENVIRONMENT_MODIFICATION: split modification ops

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !10842
2025-07-23 12:08:36 -04:00
Brad King
671b52fc5d Merge topic 'pchreuse-refactor'
11ee18b758 ci: extend msvc_v71_nmake `RunCMake.PrecompileHeaders` test timeout
1c91fadbe8 Tests/RunCMake/PrecompileHeaders: support extended timeout
42f2867b3b pchreuse: defer dependency addition until generation time
f9bc615d9a pchreuse: ban PCH reuse from targets which disable PCH
f78f592b78 pchreuse: defer target existence enforcement to generation time
3ef773490d pchreuse: defer PCH consistency checks to generation time
1d701491a2 pchreuse: always ask the PCH reuse target for PDB information
6e7da8aa95 cmGeneratorTarget: factor out reuse target computation
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: alcroito <alexandru.croitor@qt.io>
Acked-by: Vincent X <gulackeg@gmail.com>
Merge-request: !10887
2025-07-23 12:07:07 -04:00
Brad King
dbd12c8bff Merge topic 'instrumentation-windows'
f7756853c5 instrumentation: Exclude (pre|post)Build hooks with MSYS Makefiles
455944508e instrumentation: Remove ninja-specific references
7dbe092d77 instrumentation: Support preBuild and postBuild hooks on Windows
6d6c8303f9 Tests: Teach RunCMake.Instrumentation to tolerate make tool output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10932
2025-07-23 12:03:11 -04:00
Taylor Sasser
aaeffdfe6b cmArgumentParser: Refactor to allow for nested parsers 2025-07-23 09:42:05 -04:00
Evan Wilde
e301cbffcc ExternalProject: Set environment variables
Add the ability to modify the environment of the various steps running
as part of an external project build. This specifically adds the ability
to set them on the configure , build , install, and test steps, as well
as exposing the `ENVIRONMENT_MODIFICATION` keyword arguments to
`ExternalProject_Add_Step`, allowing customization of the environment of
custom steps.

The values of the environment variable respect the `LIST_SEPARATOR`.

Fixes: #26963
2025-07-22 13:13:23 -04:00
Ben Boeckel
1c91fadbe8 Tests/RunCMake/PrecompileHeaders: support extended timeout
The test can sometimes take a long time with older machines or old build
systems/compilers. Support a test-specific timeout setting.
2025-07-22 12:42:58 -04:00
Ben Boeckel
42f2867b3b pchreuse: defer dependency addition until generation time
Note that this does lose the backtrace information. It also, however,
makes `PRECOMPILE_HEADERS_REUSE_FROM` a non-magic property now.
Previously, appending to the property would miss all of its behaviors
(or leave existing setup in-place which is no longer relevant
post-append). Rather than making a policy to block appending, just defer
all logic to generation time.
2025-07-22 12:42:58 -04:00
Ben Boeckel
f9bc615d9a pchreuse: ban PCH reuse from targets which disable PCH 2025-07-22 12:42:57 -04:00
Ben Boeckel
f78f592b78 pchreuse: defer target existence enforcement to generation time
Now that generation can work with any way the state gets to the way it
is, just do the target enforcement at generation time. This allows PCH
reuse targets to be declared before or after targets which use them.

Also update `cmLocalGenerator` to use the methods now that they reliably
provide values rather than parallel construction.
2025-07-22 12:42:57 -04:00
Ben Boeckel
3ef773490d pchreuse: defer PCH consistency checks to generation time
There's no reason that during-configure inconsistencies should block
generation. It can be detected at that point instead.
2025-07-22 12:42:57 -04:00
Ben Boeckel
1d701491a2 pchreuse: always ask the PCH reuse target for PDB information
The property settings set things up once, but nothing ensures that
post-reuse hookup that any property changes propagate. Instead, when
computing PDB information, if PCH reuse is enabled, just always use its
values.

Also drop enforcement at generate time of property value consistency as
it is now ignored when PCH reuse is in effect.

Additionally, if a target is PCH-reused, generate a PDB output directory
for it.

The `PchReuseFromIgnoreOwnProps` test failed previously because the
post-reuse link update of the consuming `PDB` properties are no longer
considered. The `PchReuseFromUseUpdatedProps` failed because the
post-reuse link did not update the copy of the properties added to
consuming reuse target properties.
2025-07-22 12:42:57 -04:00
Ben Boeckel
552d5502ed Tests/RunCMake/PrecompileHeaders: rename "common" file
It is only used by `CMP0141` tests.
2025-07-22 12:42:57 -04:00
Brad King
f2727c6e05 Merge topic 'ninja-per-source-job-pool'
3a9d56d2c7 Ninja: Add support for per-source JOB_POOL_COMPILE property
44bf494fe6 Help: Global SPLIT_JOBS: reformat usages into a list.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10936
2025-07-22 12:07:38 -04:00
Tyler Yankee
f7756853c5 instrumentation: Exclude (pre|post)Build hooks with MSYS Makefiles
The implementation of (pre|post)Build hooks rely on a direct parent-
child relationship between the build system process and `ctest
--start-instrumentation`. MSYS2's `make.exe` uses the msys-runtime POSIX
compatibility layer which disrupts this relationship.
2025-07-22 11:06:41 -04:00
Tyler Yankee
7dbe092d77 instrumentation: Support preBuild and postBuild hooks on Windows
* Use `uv_disable_stdio_inheritance` to resolve the deadlock between the
parent build system process and `ctest
--wait-and-collect-instrumentation` on Windows.
* Remove Windows gating from preBuild and postBuild indexing and update
tests and documentation accordingly.

Fixes: #26668
2025-07-22 10:51:03 -04:00
Brad King
6d6c8303f9 Tests: Teach RunCMake.Instrumentation to tolerate make tool output 2025-07-21 12:41:33 -04:00
Brad King
5e26f8d3a7 Merge topic 'instrumentation-ctest-interface'
21ac285cd8 Experimental: Update the Instrumentation UUID
9dec460c8c instrumentation: Store CDash settings in query files
afa94bae1e instrumentation: Rename queries field to options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10934
2025-07-21 10:13:32 -04:00
Brad King
f8dcf102d9 Merge topic 'find-package-unwind'
f61768107e find_package: Implement UNWIND_INCLUDE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10943
2025-07-21 10:09:00 -04:00
Brad King
040c1138df Merge topic 'linux32-time64'
a760a74abf Tests: Optionally skip tests requiring 64-bit time_t
14e21fa992 bootstrap: Compile with 64-bit time_t on 32-bit Linux if possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10951
2025-07-21 10:02:26 -04:00
Bastien Montagne
3a9d56d2c7 Ninja: Add support for per-source JOB_POOL_COMPILE property
This commit allows to override a global or target-wide 'job pool'
property on a per-source basis.

It modifies the Ninja generator to first look into the source's
properties, and only use the target properties as a fallback.

The new `source` parameter to
`cmNinjaTargetGenerator::addPoolNinjaVariable` may be null, e.g. when
the function is called in context where there is no source (e.g. a
linking task).

Closes: #23994
2025-07-16 21:16:24 +02:00
Brad King
a760a74abf Tests: Optionally skip tests requiring 64-bit time_t
On some platforms, `time_t` is always 32-bit.  Add an explicit option
to skip tests that require 64-bit `time_t`.
2025-07-16 14:28:43 -04:00
Brad King
369c36503d Merge topic 'export-use-subcommand'
998495cb49 cmExportCommand: Port to cmSubcommandTable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vito Gamberini <vito.gamberini@kitware.com>
Merge-request: !10947
2025-07-16 13:49:00 -04:00
Taylor Sasser
998495cb49 cmExportCommand: Port to cmSubcommandTable
Previously, the `cmExportCommand` parser did not use `cmSubcommandTable`
to distinguish between its `TARGETS`, `EXPORT`, `SETUP`, and `PACKAGE`
modes.  This created a maintenance burden when updating or adding
functionality.

Refactor the parser to use a subcommand for each keyword.  This new
structure mirrors the design of `cmInstallCommand` and simplifies future
development.
2025-07-16 11:33:48 -04:00
Brad King
1f9de0c82d Merge topic 'cmake-parent-fix'
41aea12941 Do not define CMAKE_PARENT_LIST_FILE in CMakeLists.txt

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10930
2025-07-16 11:27:00 -04:00
Benjamin Buch
41aea12941 Do not define CMAKE_PARENT_LIST_FILE in CMakeLists.txt
Add policy `CMP0198` for compatibility.

Issue: #25026
2025-07-15 11:51:45 -04:00
Brad King
f19fa50b48 Merge topic 'string-json-better-error'
35f002e293 string(JSON): Include invalid JSON in parse error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10944
2025-07-15 10:56:02 -04:00
Brad King
d4306378b9 Merge topic 'freebsd_linker_variables'
7ae11ea4e7 Platform: Add compiler platform modules for BSDs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10919
2025-07-15 10:54:13 -04:00
Martin Duffy
21ac285cd8 Experimental: Update the Instrumentation UUID
Update experimental UUID for instrumentation after commit afa94bae1e
(instrumentation: Rename queries field to options, 2025-07-08) broke compatibility
for old queries.
2025-07-15 08:38:44 -04:00
Martin Duffy
9dec460c8c instrumentation: Store CDash settings in query files
Adds new `cdashSubmit` and `cdashVerbose` options to allow enabling
instrumentation in CDash submissions using query files or the
`cmake_instrumentation` command.

Fixes: #26783, #26727
2025-07-14 15:44:52 -04:00
Vito Gamberini
f61768107e find_package: Implement UNWIND_INCLUDE
This implements a limited exception mechanism for find_package() via
the UNWIND_INCLUDE keyword.

When package discovery via find_package(UNWIND_INCLUDE) fails the
StateSnapshot is updated to an UNWINDING state. In this state further
calls to find_package() and include() are forbidden. While in the
UNWINDING state, the include() command immediately calls
SetReturnInvoked() whenever it is reached.

The UNWINDING state is reset when a parent call to find_package() is
reached.

Fixes: #26897
2025-07-13 16:08:19 -04:00
Craig Scott
4315076f2e fileapi: Add codemodelVersion fields to target and directory objects
This will allow JSON schemas for these two types of files to describe the
version-specific content without requiring any outside information.

Fixes: #27031
2025-07-13 14:59:03 +10:00
Undefine
7ae11ea4e7 Platform: Add compiler platform modules for BSDs
These set variables required for CMAKE_LINKER_TYPE to work

Fixes: #27037
2025-07-12 21:36:42 +02:00
Martin Duffy
35f002e293 string(JSON): Include invalid JSON in parse error 2025-07-11 11:16:39 -04:00
Martin Duffy
afa94bae1e instrumentation: Rename queries field to options
Fixes: #26728
2025-07-10 16:25:07 -04:00
Brad King
5cb9891d64 Merge topic 'windows-kernel-mode-driver'
2f5dce1b40 cmExperimental: remove the flag for Windows Kernel Mode Driver support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10937
2025-07-10 10:30:26 -04:00
Brad King
265c676445 Merge topic 'windows-kernel-mode-driver' into release-4.1
2f5dce1b40 cmExperimental: remove the flag for Windows Kernel Mode Driver support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10937
2025-07-10 10:30:23 -04:00
Brad King
bb47b25993 Merge topic 'file-api-fileset-fix'
ea6404b9c4 FileAPI: Ignore unresolved FileSet generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: autoantwort <leander.schulten@rwth-aachen.de>
Merge-request: !10938
2025-07-10 10:29:01 -04:00
Vito Gamberini
ea6404b9c4 FileAPI: Ignore unresolved FileSet generators
Fixes: #27054
2025-07-09 10:08:47 -04:00
Brad King
2f5dce1b40 cmExperimental: remove the flag for Windows Kernel Mode Driver support
Enable setting `CMAKE_SYSTEM_NAME` to `WindowsKernelModeDriver` without
an experimental gate.
2025-07-09 09:54:45 -04:00
Brad King
f143b8a623 Merge topic 'keyword-project-name-fix'
a38e594340 project: fix keyword argument as project name
7238c8c999 ArgumentParser: implement HasKeyword helper

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10935
2025-07-09 09:44:50 -04:00