Files
cmake/Help/release/dev/test-prep-makefile-generators.rst
Daksh Mamodiya 503bdb9777 Makefile: Generate test_prep targets for CMAKE_TEST_BUILD_DEPENDS
Extend the test_prep/<test> and test_prep/all build targets, generated
from add_test(BUILD_DEPENDS) when CMAKE_TEST_BUILD_DEPENDS is enabled, to
the Makefile generators.  Previously only the Ninja and FASTBuild
generators provided them.

Resolve each test's dependencies in a shared layer so all command-line
generators consume one result.  cmTestGenerator now filters target
dependencies to build-system targets and records, for each file
dependency, the single target that produces it as a primary
custom-command output (cmGlobalGenerator::FindOutputOwningTarget).  The
Makefile generators emit phony rules in CMakeFiles/Makefile2 depending on
<target>.dir/all, with top-level forwarding rules.  Sharing the
resolution also stops Ninja and FASTBuild from emitting a dead test_prep
edge for a non-buildable (e.g. INTERFACE) BUILD_DEPENDS target.

On the Makefile generators a file dependency that no single target
produces, and a test whose name contains ':', cannot be expressed as a
recursive-make rule and are reported with a warning and skipped.

Fixes: #27879
2026-06-24 17:24:54 +02:00

10 lines
489 B
ReStructuredText

test-prep-makefile-generators
-----------------------------
* The :generator:`FASTBuild` generator and the :ref:`Makefile Generators`
now generate ``test_prep/<test-name>`` and ``test_prep/all`` convenience
build targets when the :variable:`CMAKE_TEST_BUILD_DEPENDS` variable is
enabled, matching the behavior of the :ref:`Ninja Generators`. These
targets build the dependencies of tests added by :command:`add_test`,
including those listed with the ``BUILD_DEPENDS`` keyword.