Commit Graph
542 Commits
Author SHA1 Message Date
Marc Chevrier 386d1d874c Add support of custom rules
Fixes: #27383
2026-09-20 11:43:10 +02:00
Vito Gamberini ab1bd6f6c6 c++modules: Remove CXX_MODULE_STD and CMAKE_CXX_COMPILER_IMPORT_STD
Fixes: #27966, #27992, #28000
2026-08-03 10:05:34 -04:00
Brad King 5b0aee4961 Drop Visual Studio 14 2015 generator
This generator has been deprecated since CMake 4.2.  Remove it.
2026-07-03 11:53:32 -04:00
Matthew Woehlke a5a9ec9113 TargetTypes: Extract target-related types to dedicated header
Move some target related enumeration types from `cmStateTypes.h` to a
new header, as these really aren't "state" types. Also, make
`TargetType` a strongly-typed enumeration.
2026-07-01 14:44:11 -04:00
Martin Duffy e11b5827c3 ctest: Add --out-of-date option for running out of date tests
Add an --out-of-date option to ctest which runs only those tests with
recorded build dependencies whose timestamps are newer than the timestamp
at which the test last finished.

Fixes: #27614
2026-06-30 11:31:35 -04:00
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
Vito Gamberini 6d3e9d8220 c++modules: single import std target 2026-06-18 15:20:54 -04:00
Brad King f4c858d328 Merge topic 'multi_export_sbom'
2900aa2911 SBOM: Update experimental UUID
273fc4cc49 SBOM: Support multi export set SBOMs
9669829573 Install: Refactor ResolveTargetsInGeneratorExpression
7c31cbf9ae SBOM: Handle PACKAGE_URL argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12080
2026-06-02 09:15:40 -04:00
Tom Osika 273fc4cc49 SBOM: Support multi export set SBOMs 2026-06-01 12:27:13 -04:00
Joseph Snyder 243462fafe try_compile: Tolerate compile features from non-enabled languages
Do not copy the list of enabled languages from the outer generator.
It is populated as languages are enabled inside the test project.

Fixes: #27684
2026-05-26 20:17:27 -04:00
Brad King bbab63839b cmGlobalGenerator: Clarify name of try_compile-specific member 2026-05-26 20:16:44 -04:00
Baudouin Feildel 881faf67e5 Rust: Switch to building .rs files to .rlib instead of native object files
Each Rust source file given to a target is considered a separate crate
root. There's a concept of a "main crate root", which is the `.rs` file
that is given to the final linker phase in CMake. Other Rust source file
in a target are built as rlib separately.

The project can still build `.rs` files into object files by setting the
Rust_EMIT property on the desired source file.
2026-03-20 09:42:44 -04:00
Tyler Yankee 8b350fae71 CMP0210: Warn at most once per CMAKE_<LANG>_LINK_FLAGS variable
Additionally, add more testing for the warning case.

Issue: #21934
2026-02-18 11:44:07 -05:00
John Franklin Rickard 9daa1012d4 cmGlobalGenerator: Avoid string copies by returning view 2026-02-06 12:27:23 -05:00
John Franklin Rickard 6ed75b1fe6 cmGlobalGenerator: Use transparent comparator to avoid string copies 2026-02-06 12:27:13 -05:00
John Franklin Rickard c3c3b10d60 cmGlobalGenerator: Change parameter to string_view 2026-02-06 12:27:12 -05:00
Brad King a6b3e2a7de Merge topic 'detect-colliding-target-dirs'
bc7fac6ad3 cmGeneratorTarget: detect colliding target directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11658
2026-02-06 10:23:48 -05:00
Ben Boeckel bc7fac6ad3 cmGeneratorTarget: detect colliding target directories
Some projects might get unlucky and have targets which collide in the
sha3-512 hash (truncated to 4) in a directory which also collides in the
same way (easily done by sharing it). Note such problems as potentially
colliding and offer potential remedies.

Also add a test which generates the error.

Closes: #27465
2026-02-05 12:33:56 -05:00
William Allen c71e3abbad cmake --build: Factor out a struct holding build parameters
This commit extracts the set of parameters required to build a CMake
project into a dedicated class.  While this class is currently just a
wrapper for the data, the goal is to eventually implement a validate()
method which verifies that a given configuration contains the minimum
set of information required to execute a build, and that any optional
options are compatible with one another.
2025-12-17 10:56:18 -05:00
Eduard Voronkin e42881422f FASTBuild: optimize try_compile builds
The generator does a lot of tricks in order to make the "rebuild-bff"
target up-to-date immediately after the generation. We can skip all of
those during "TryCompile" runs, which should reduce configure time.
2025-10-22 17:32:48 -07:00
Brad King 50f87b4bf2 cmGlobalGenerator: Simplify collection of targets under a project() 2025-09-16 11:32:27 -04:00
Ben Boeckel 84372ce0b5 prop_sf/OBJECT_NAME: no-op for the FASTBuild and Xcode generators
There's no control over the object base name implemented in the
FASTBuild generator. Rather than expecting some half-supported behavior,
just ignore it completely there.

Similarly, Xcode ends up making its own object paths internally
regardless of what CMake would like.
2025-09-09 09:58:07 -04:00
Brad King 54e7008e2d Merge topic 'vs-cleanup'
78d9564d50 cmGlobalVisualStudio7Generator: Inline short method at only call site
034cc29b89 cmGlobalVisualStudio7Generator: Constify .sln write methods
5004602715 cmGlobalVisualStudio7Generator: Factor folder collection out of write method
6ae4ed30d9 cmGlobalVisualStudio7Generator: Factor target collection out of write method
5582eb292e cmGlobalVisualStudio7Generator: Update outdated comment
2297ba9399 cmGlobalVisualStudio7Generator: Remove redundant C++ modules check
ccbd61dd53 cmGlobalVisualStudio7Generator: Remove unused member
93e34a5e0e cmGlobalGenerator: Constify GetTargetDirectDepends
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11130
2025-09-02 10:56:09 -04:00
Brad King 93e34a5e0e cmGlobalGenerator: Constify GetTargetDirectDepends
It should only be called for targets whose dependencies are already
computed.
2025-09-01 15:25:18 -04:00
Eduard Voronkin 01147454e7 FASTBuild: Add generator
Fixes: #15294
2025-08-26 14:29:01 -07:00
Eugene Zimichev da330bcf88 macOS: Cache parsed xcframework plist content
Avoid repeating `plutil` calls on the same plist files.

Fixes: #27023
2025-08-15 10:15:54 -04:00
Daniel Pfeifer ee1c32b6d7 source: Pass cmBuildOptions by value 2025-07-30 11:55:34 -04:00
Ben Boeckel 8180ecad9b autogen: support the SHORT intermediate dir strategy 2025-07-29 09:44:03 -04:00
John Parent 324907a60b cmGlobalGenerator: add methods for use when implementing short dir support 2025-07-29 08:06:28 -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 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
Brad King b05e5403d9 Experimental: Avoid mutating statically allocated data 2025-05-13 10:25:02 -04:00
Brad King e78cf73b52 Merge topic 'makefile-progress'
5781cf406f Makefile: Fix progress with non-excluded targets in excluded dirs
89ab14b05b cmGlobalGenerator: Constify IsExcluded use of cmLocalGenerator
0aabf32590 cmGeneratorExpression: Constify use of cmLocalGenerator
88f54fba43 cmLocalGenerator: Avoid unnecessary const-ness propagation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10658
2025-04-17 10:00:51 -04:00
Brad King 89ab14b05b cmGlobalGenerator: Constify IsExcluded use of cmLocalGenerator 2025-04-15 10:44:32 -04:00
Marc Chevrier 2e9648e0de Ninja generator: restore correct encoding for policy CMP0181=OLD
Fixes: #26857
2025-04-12 16:37:57 +02:00
Kitware Robot 1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Kitware Robot 0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Brad King 10cfc8f538 Merge topic 'extern-domain'
e109307c43 Add support for foreign targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10171
2025-01-22 09:30:49 -05:00
Vito Gamberini e109307c43 Add support for foreign targets 2025-01-21 15:26:40 -05:00
Brad King 9b148ed1ac CMP0042: Remove support for OLD behavior 2025-01-19 09:41:02 -05:00
Brad King 84f737545f CMP0037: Remove support for OLD behavior 2025-01-19 09:41:01 -05:00
Brad King f8bc8780c1 CMP0026: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King 65b45de1dd CMP0024: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King 41a7a0119f CMP0018: Remove support for OLD behavior 2025-01-18 09:51:44 -05:00
Martin Duffy 097d4fd1b5 instrumentation: Collect and record project build system metrics
Add a feature for collecting build instrumentation for CMake projects.

Issue: #26099
2025-01-15 09:16:50 -05:00
Garrett Campbell 9ed178f9d8 Add generator-agnostic DEBUGGER_WORKING_DIRECTORY target property
Generalize the `VS_DEBUGGER_WORKING_DIRECTORY` property.

Issue: #16478
2024-12-09 10:47:10 -05:00
Martin Duffy ea8e3107ec cmake --install: Respect CMAKE_DEFAULT_CONFIGS
When `cmake --install` is run with no `--config` passed, use
`CMAKE_DEFAULT_CONFIGS` to determine which config(s) to install.

Fixes: #21475
2024-11-19 11:37:47 -05:00
Martin Duffy f50fb77a4f Ninja: Regenerate when test or install scripts are missing
Rerun CMake when `cmake_install.cmake` or `CTestTestfile.cmake` are out
of date.  This enables regeneration if a subdirectory is removed before
invoking `ninja`.

Fixes: #26396
2024-11-06 08:35:57 -05:00
Brad King 14e17a83be cmGlobalGenerator: Clarify Build method output mode argument name 2024-10-17 08:37:12 -04:00