Commit Graph

71253 Commits

Author SHA1 Message Date
Brad King aec52661a3 Merge topic 'genex-transitive-link-libraries' into release-4.1
e0bbe79cea CMP0189: Restore support for linking `$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>`
cb69f750bf cmGeneratorTarget: Factor out helper to detect LINK_LIBRARIES evaluation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11262
2025-09-30 09:59:07 -04:00
Brad King e0bbe79cea CMP0189: Restore support for linking $<TARGET_PROPERTY:tgt,LINK_LIBRARIES>
In general we disallow references to transitive target properties, such
as `COMPILE_DEFINITIONS`, in `[INTERFACE_]LINK_LIBRARIES` properties,
because the latter establish the transitivity itself.  Prior to CMP0189,
the `[INTERFACE_]LINK_LIBRARIES` properties were not themselves transitive
in `$<TARGET_PROPERTY>` expressions, so existing projects have code like

    target_link_libraries(foo PRIVATE "$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>")

Policy CMP0189's NEW behavior, introduced by commit b3da9c6d60 (GenEx:
Evaluate LINK_LIBRARIES target properties transitively, 2025-02-24,
v4.1.0-rc1~731^2), makes `$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>`
transitive, causing the above to be rejected.  Since evaluation of a
target's link libraries can already encounter and handle other targets'
link libraries, allow it in this case.

Fixes: #27265
2025-09-29 10:51:01 -04:00
Brad King cb69f750bf cmGeneratorTarget: Factor out helper to detect LINK_LIBRARIES evaluation 2025-09-26 17:41:41 -04:00
Brad King 24ede8c516 Merge branch 'release-4.0' into release-4.1 2025-09-25 09:01:35 -04:00
Brad King c4095eaf86 Merge branch 'release-3.31' into release-4.0 2025-09-25 09:01:23 -04:00
Brad King 7ef733450c Merge topic 'bootstrap-devirtualization' into release-4.1
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11243
2025-09-25 09:00:39 -04:00
Brad King 21bc83344c Merge topic 'bootstrap-devirtualization' into release-4.0
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11243
2025-09-25 08:58:51 -04:00
Brad King 2303c04c20 Merge topic 'bootstrap-devirtualization' into release-3.31
ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11243
2025-09-25 08:57:57 -04:00
Brad King ea04e19daf bootstrap: Fix compilation with gcc 16 devirtualization
Avoid including a header for a subclass whose implementation is not
compiled during bootstrap.

Fixes: #27256
2025-09-24 17:20:35 -04:00
Brad King 98961a7dd4 Merge branch 'release-4.0' into release-4.1 2025-09-24 14:07:54 -04:00
Brad King a2faa7af28 Merge branch 'release-3.31' into release-4.0 2025-09-24 14:07:42 -04:00
Brad King 622044ce33 CMake 3.31.9 v3.31.9 2025-09-24 13:24:34 -04:00
Brad King e46097dbfa Merge topic 'file-GENERATE-CMP0189' into release-4.1
deb7b4b658 file(GENERATE): Record CMP0189 at each call site
9b862e7013 cmGeneratorTarget: Pass genex evaluation context to IsTransitiveProperty

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11234
2025-09-24 08:45:12 -04:00
Brad King deb7b4b658 file(GENERATE): Record CMP0189 at each call site
Policy CMP0189, introduced by commit b3da9c6d60 (GenEx: Evaluate
LINK_LIBRARIES target properties transitively, 2025-02-24,
v4.1.0-rc1~731^2), takes effect at generation time, and so uses the
policy value as of the end of each directory.  However, some projects
may rely on `file(GENERATE)` with the policy's OLD behavior in order
to extract targets' *direct* dependencies from `LINK_LIBRARIES`.
Pending a first-class solution to that problem, make it easier for
projects to port to the policy's NEW behavior in general while
retaining the OLD behavior in an isolated context.

Fixes: #27220
2025-09-23 11:30:22 -04:00
Brad King 9b862e7013 cmGeneratorTarget: Pass genex evaluation context to IsTransitiveProperty 2025-09-23 10:57:22 -04:00
Brad King 6201ff1864 Merge topic 'doc-CMP0189' into release-4.1
e8d779c935 Help: Document when policy CMP0189 takes effect

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11230
2025-09-23 09:14:14 -04:00
Brad King e8d779c935 Help: Document when policy CMP0189 takes effect
This was left out of commit b3da9c6d60 (GenEx: Evaluate LINK_LIBRARIES
target properties transitively, 2025-02-24, v4.1.0-rc1~731^2).

Issue: #27220
2025-09-22 15:21:05 -04:00
Brad King 7cfe68619b Merge topic 'genex-refactor' into release-4.1
77570a1ac1 GenEx: Consolidate target property evaluation context arguments
1735b0d147 GenEx: Construct cmGeneratorExpressionDAGChecker with full evaluation context
d4d204382f GenEx: Collect evaluation arguments into local Context structures
b40a53e931 GenEx: Factor out a dedicated evaluation Context structure
e1035dc307 GenEx: Rename cmGeneratorExpressionContext to cm::GenEx::Evaluation
905cfcfa12 cmGeneratorExpressionNode: Simplify EvaluateDependentExpression signature
fe8e82090b cmGeneratorExpressionEvaluationFile: Constify some local generator usage
8321178a23 cmFileSet: Constify local generator usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11224
2025-09-22 10:14:26 -04:00
Brad King 77570a1ac1 GenEx: Consolidate target property evaluation context arguments 2025-09-21 20:20:03 -04:00
Brad King 1735b0d147 GenEx: Construct cmGeneratorExpressionDAGChecker with full evaluation context
Extend commit e8010b67c7 (cmGeneratorExpressionDAGChecker: Make local
generator available in constructor, 2024-04-25, v3.30.0-rc1~172^2~6) and
commit 633afa0b2e (cmGeneratorExpressionDAGChecker: Make config name
available in constructor, 2024-05-08, v3.30.0-rc1~82^2~2) to make the
full evaluation context available in the constructor.
2025-09-21 20:20:03 -04:00
Brad King d4d204382f GenEx: Collect evaluation arguments into local Context structures 2025-09-21 20:17:16 -04:00
Brad King b40a53e931 GenEx: Factor out a dedicated evaluation Context structure
The context's local generator, configuration name, and language are
constant throughout evaluation.
2025-09-21 18:58:55 -04:00
Brad King e1035dc307 GenEx: Rename cmGeneratorExpressionContext to cm::GenEx::Evaluation
It has grown to hold information about the evaluation itself,
not just the context in which the evaluation occurs.
2025-09-21 18:58:55 -04:00
Brad King 905cfcfa12 cmGeneratorExpressionNode: Simplify EvaluateDependentExpression signature
The local generator is available in the evaluation context.
2025-09-21 18:58:55 -04:00
Brad King fe8e82090b cmGeneratorExpressionEvaluationFile: Constify some local generator usage 2025-09-21 18:58:55 -04:00
Brad King 8321178a23 cmFileSet: Constify local generator usage 2025-09-21 18:58:55 -04:00
Brad King 6de0334c9c Merge branch 'release-4.0' into release-4.1 2025-09-21 18:57:43 -04:00
Brad King 72fcfe5b36 Merge topic 'ci-xcode-26' into release-4.1
965a12cb8a ci: update macOS jobs to use Xcode 26.0
edaa6ed06a Tests: Teach RunCMake to ignore Xcode an IDERunDestination warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11209
2025-09-21 18:56:48 -04:00
Brad King 90e1300983 Merge topic 'ci-xcode-26' into release-4.0
965a12cb8a ci: update macOS jobs to use Xcode 26.0
edaa6ed06a Tests: Teach RunCMake to ignore Xcode an IDERunDestination warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11209
2025-09-21 18:56:09 -04:00
Brad King 965a12cb8a ci: update macOS jobs to use Xcode 26.0 2025-09-19 08:19:34 -04:00
Brad King edaa6ed06a Tests: Teach RunCMake to ignore Xcode an IDERunDestination warning
On some Xcode versions, `xcodebuild` may warn:

    ... xcodebuild[...] IDERunDestination: ...

Teach RunCMake to drop such incidental lines before matching against
expected output.
2025-09-19 08:19:34 -04:00
Brad King 3b95dadd08 Merge topic 'lfortran-0.55' into release-4.1
3b85cc1a8e Tests: Extend RunCMake.ParseImplicitLinkInfo for LFortran 0.55.0
7e8f76dad2 LFortran: Update flags renamed by version 0.55

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11184
2025-09-16 08:50:40 -04:00
Brad King 3b85cc1a8e Tests: Extend RunCMake.ParseImplicitLinkInfo for LFortran 0.55.0 2025-09-15 20:34:16 -04:00
Christopher Albert 7e8f76dad2 LFortran: Update flags renamed by version 0.55
The `--generate-object-code` flag is now `--separate-compilation`.

Fixes: #27225
2025-09-15 20:34:16 -04:00
Brad King 31fd368e80 Merge topic 'GNUInstallDirs-cached-default' into release-4.1
2e88a3efc2 GNUInstallDirs: Fix regression on -DCMAKE_INSTALL_<dir>=<default> in /usr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11167
2025-09-11 13:05:19 -04:00
Cristian Le 2e88a3efc2 GNUInstallDirs: Fix regression on -DCMAKE_INSTALL_<dir>=<default> in /usr
Fix commit 9789f7d05e (GNUInstallDirs: Add internal helper to compute
specific defaults, 2025-03-28, v4.1.0-rc1~384^2~3) to avoid updating
explicitly-specified cache entries on the first run.  Do not reset the
default value until at least the second run, during which we have
`_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX` already defined.

Fixes: #27211
2025-09-10 16:03:43 -04:00
Brad King 9523d66df2 Merge topic 'iar-asm' into release-4.1
87d95b2222 ASM: Restore CMAKE_ASM_COMPILER_ARCHITECTURE_ID persistence

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11160
2025-09-09 09:45:32 -04:00
Brad King e7fd2b3251 Merge branch 'release-4.0' into release-4.1 2025-09-08 15:57:08 -04:00
Brad King edd51d646c CMake 4.0.4 v4.0.4 2025-09-08 14:51:44 -04:00
Brad King 87d95b2222 ASM: Restore CMAKE_ASM_COMPILER_ARCHITECTURE_ID persistence
Refactoring in commit 019f0f8b32 (ARCHITECTURE_ID: Save persistently
even if empty, 2025-03-13, v4.1.0-rc1~499^2~1) accidentally dropped
part of the variable name in `CMakeASMCompiler.cmake`.

Reported-by: Felipe Torrezan <felipe.torrezan@iar.com>
2025-09-08 10:38:30 -04:00
Brad King 0747545129 Merge topic 'FindPython-ABI-handling' into release-4.1
c504b1c638 FindPython: Ensure correct handling of Python_FIND_ABI variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11145
2025-09-05 09:04:52 -04:00
Marc Chevrier c504b1c638 FindPython: Ensure correct handling of Python_FIND_ABI variable
Fixes: #27192
2025-09-04 15:06:57 +02:00
Brad King a4dd4f3dad Merge topic 'ninja-custom-command-comment-syntax' into release-4.1
1bf48e34f4 Ninja: escape special characters in custom command comments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11136
2025-09-03 10:20:15 -04:00
Brad King 08b9257473 Merge topic 'project-version-fix' into release-4.1
aa16b8eb9a project: Revert changes to VERSION handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11131
2025-09-03 10:17:12 -04:00
Brad King 154bab609c Merge branch 'release-4.0' into release-4.1 2025-09-03 10:14:14 -04:00
Brad King cd7cd67fd5 Merge topic 'curl-opt-proxytype' into release-4.1
c8143074cf cmCTestCurl: Avoid using undocumented type for CURLOPT_PROXYTYPE values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11134
2025-09-03 10:13:30 -04:00
Brad King a51ae8b7f9 Merge branch 'release-3.31' into release-4.0 2025-09-03 10:12:42 -04:00
Brad King 2bc0c335ce Merge topic 'curl-opt-proxytype' into release-4.0
c8143074cf cmCTestCurl: Avoid using undocumented type for CURLOPT_PROXYTYPE values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11134
2025-09-03 10:12:21 -04:00
Brad King 2ea11c1a6e Merge topic 'curl-opt-proxytype' into release-3.31
c8143074cf cmCTestCurl: Avoid using undocumented type for CURLOPT_PROXYTYPE values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11134
2025-09-03 10:11:43 -04:00
Ben Boeckel 1bf48e34f4 Ninja: escape special characters in custom command comments
Considerations of Ninja's control sequences was not considered in
30fb5b1b22 (Ninja: add COMMENT to build statement descriptions,
2024-05-01) via !9484. Escape both newlines and dollar signs.

Fixes: #27181
2025-09-02 15:33:20 -04:00