They don't support setting compiler via this variable, they use the
toolsets, so you could switch the compiler by choosing another toolset.
Closes: #21644
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
Rename the compiler id from commit ee76398d23 (IBMLLVMFlang: Add support
for this compiler, 2026-05-25) to mention only the direct vendor, IBM.
Issue: #27863
2e214f0a5b ctest: allow CTest Script variables to be set via the command-line
21b9c20592 ctest: extend config mapping to include script-only variables
68489471a6 ctest: refactor SetCMakeVariables to use a mapping table
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12060
Add `test_prep/<test_name>` convenience targets to the ninja generator
to build dependencies of tests, and `test_prep/all` to build the dependencies
of all tests.
Build dependencies of a test include:
- Executables directly invoked by test `COMMAND`.
- Targets mentioned in generator expressionf os test `COMMAND`.
- Anything explicitly listed with the new `BUILD_DEPENDS` argument of `add_test`.
Issue: #27613
This was left out of commit b7a5f2732d (PellesC: Add minimal support for
this C compiler, 2026-04-03) because the implementation was not usable
in general. It is now.
Closes: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
72e7305c3e Diagnostics: Handle CMAKE_{WARN,ERROR}_DEPRECATED
be057c5a01 cmVariableWatch: Use enum for access type
cba542f32c cmake.cxx: Organize includes
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11948
Update documentation for aforementioned variables, as their use is
deprecated under the new diagnostic system. Introduce a policy which
reintroduces their use to control specific deprecation diagnostics if
the policy is not NEW.
Note that this means there is NO synchronization between the variables
and the new diagnostic state.
Make diagnostics into Sphinx objects so that they can be more readily
cross-referenced. (This is also needed to enable --help-diagnostic.)
Update various places that can make use of the same. Significantly
expand the documentation on controlling diagnostics.
Add a `CTEST_TEST_COVERAGE_TOOL` variable to tell CTest to integrate
with `llvm-cov` source-based code coverage by setting the
`LLVM_PROFILE_FILE` environment variable for each test.
Issue: #26932
39a56136a3 Diagnostic: Add warn or error on absolute install paths
fd76089631 cmInstallFileSetGenerator: Only support per config Destination.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11882
Add `-Winstall-absolute-destination` diagnostic to warn or
error when an install command has an absolute destination.
This allow projects to enforce the best practice of not allowing
absolute install DESTINATIONS.
Add policy CMP0215 to emit `.swiftmodule` from a dedicated `-emit-module`
build edge for importable Swift targets in the Ninja generator.
Downstream targets can begin compiling as soon as the module interface
is ready, overlapping with upstream object compilation and linking.
When CMP0215 is NEW and CMP0157 is NEW, separate module emission is
enabled by default. The `Swift_SEPARATE_MODULE_EMISSION` target
property (initialized by the `CMAKE_Swift_SEPARATE_MODULE_EMISSION`
variable) can override this per target.
The compile edge still passes `-emit-module` so that swiftc continues
to produce `.swiftdoc`; only the `.swiftmodule` output moves to the new
edge.
Also fix swiftmodule dependency edges in cmNinjaNormalTargetGenerator
to use IsLanguageUsed instead of GetLinkerLanguage, so C/C++ targets
whose linker language propagated to Swift do not produce spurious
implicit dependencies.
Closes: #27748
99318e49b9 Help: Mention when diagnostics were added
daec98ba61 Diagnostics: Fix passing diagnostic state to try_compile
e0b0ac4295 Diagnostics: Overhaul warnings in cmake-gui
ca5d569524 Diagnostics: Switch state to new system
618c074a8c Diagnostics: Use categories for presets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11855
Add an additional state to the cmake instance to track diagnostics. Use
this to initialize any new/reset states we create so that other contexts
will inherit the diagnostic state from presets / command-line options.
Modify the front-end to map presets and -W command-line options to
manipulation of this new diagnostic state. Remove old members for
storing diagnostic state. Rework how diagnostic state is persisted.
Deprecate old, non-standard spellings for manipulating diagnostics.
Deprecate old 'dev' spelling for CMD_AUTHOR.
Note that this is a work in progress. Messaging has not yet been
updated, so the new state is not yet being used to control diagnostics,
and some of the logic to update the old state has been stripped (and
will eventually be removed entirely). Backward compatibility support for
the deprecated CMAKE_{WARN,ERROR}_DEPRECATED variables is only partially
implemented. The GUI's interface for manipulating warnings is partially
broken and needs to be overhauled. These tasks are being done in
separate commits in order to minimize review burden and keep the changes
per commit / per merge request more manageable.
Add a new CMake domain role for referencing fields in CMake presets.
This has two main purposes. First, it replaces generic references (which
were excessively long and required explicit titles) and acts as an
improved version of the `ref` role by allowing the always-present
`CMakePresets.` prefix to be elided. Second, unlike generic references
which silently degrade to broken links that are only caught by
`linkcheck`, broken references are flagged immediately in regular Sphinx
builds. Therefore, this both improves presentation by bringing line
lengths back under control, and reduces errors by making bad references
immediately detectable.
There is also a small change in rendering, as field references are now
rendered as literals. This is consistent with how fields are mentioned
in prose when they are not linked.
Replace the CMake presets schema.json with a YAML document, from which
both the JSON schema and (most of) the reST documentation are generated.
This achieves three main goals. First, the YAML document is much closer
to being human-readable than the JSON schema. Second, the JSON and reST
prose (when the latter differs) are contained in the same file, in most
cases adjacent (and at worst, still nearby) rather than in separate
files, which should greatly facilitate keeping the two in sync. Third,
changes are monumentally easier, as changes merely need to annotate the
version(s) to which variants apply, rather than creating entirely
separate schema trees for each variant.
Since requiring Python as part of the build process is not desired,
the outputs are kept in the source repository. This is consistent with
other areas which are seldom updated and require special tools, such as
the lexer.
While this does not represent any functional change for users, some
grammatical edits and other such editorial improvements have been made
in the process of transferring everything to the new YAML. However,
these are mainly incidental rather than representative of an attempt at
a thorough editorial pass.
Finally, for clarity, monkey-patch `sphing.domains.changesets` and add
additional 'version modified' directives with slightly tweaked text to
identify changes to the presets schema. These are nearly identical to
the built-in directives, but use the text 'in presets version N' rather
than 'in version N[.N]'.
Several problems with this feature came up while testing 4.3.0-rc1.
These include both broken stdlib distributions and regressions in our
implementation of the feature since CMake 4.2.
Revert commit 70c1f0f43d (Experimental: Remove import std experimental
gate, 2026-02-04, v4.3.0-rc1~61^2) except for its incidental fixes.
Remove the 4.3 release notes related to `import std`.
Rotate the experimental gate's UUID.
Issue: #27426
Issue: #27597
Issue: #27626
Issue: #27635
Changes:
- Added some initial operating system family categories (Apple, UNIX,
Windows).
- Used list instead of table. Unlike the tables, lists provide
documenting additional info and CMake versions.
- Added CMake versions to most values where they were introduced or
could be determined from the Git log.
- Additionally added the OHOS value to the list (introduced via #25987)
- Emscripten name was used by toolchain files also before CMake 4.2 but
documented with this version.
The format example for CMAKE_INSTALL_EXPORTS_AS_PACKAGE_INFO is quite
long and, in its prior state, was likely to force a line wrap before it,
which could lead to non-optimal spacing of the preceding line. As there
is no easy way to break in the middle of the example, instead break it
out into a separate element.
Remove basic CPS import and export from 'experimental' status. Update
documentation and tests accordingly.
Note that mapped exports (CMAKE_EXPERIMENTAL_MAPPED_PACKAGE_INFO) are
still experimental.