Commit Graph

11873 Commits

Author SHA1 Message Date
Brad King
0a05e1d039 Merge topic 'find_package-empty-roots'
adfb0623cb find_package: Fix assertion failure on empty sysroots
1c6cecdce9 cmFindPackageCommand: Fix searching a root path as a prefix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10113
2024-12-20 09:20:14 -05:00
Brad King
79e41d3cc6 Merge topic 'rpath-preserve-setuid-setgid'
0907a322f3 install: Restore SETUID/SETGID after RPATH change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10053
2024-12-20 09:18:24 -05:00
Brad King
adfb0623cb find_package: Fix assertion failure on empty sysroots
Previously we crashed if at least one root variable was set to empty and
at least one to non-empty.

Fixes: #26538
2024-12-19 09:58:02 -05:00
Volodymyr Zolotopupov
0907a322f3 install: Restore SETUID/SETGID after RPATH change
Most Unix-like systems drops the SETUID/SETGID bits when a file changes,
so after changing the RPATH, it is necessary to restore
the original file mode.
2024-12-19 08:29:44 -05:00
Brad King
5c7bb0bfd9 Merge topic 'rename-cmakelists'
fcbc883fa3 cmake: Allow configuration of default script names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !10059
2024-12-18 08:49:58 -05:00
Martin Duffy
fcbc883fa3 cmake: Allow configuration of default script names
Adds the ``--project-file`` command-line option to modify the default script
name loaded by CMake and ``add_subdirectory`` to values other than
``CMakeLists.txt``.

Fixes: #21570
2024-12-17 12:47:02 -05:00
Brad King
6f3ec4a341 Merge topic 'GenEx-PATH-NATIVE_PATH'
427be46424 GenEx $<PATH>: Add NATIVE_PATH sub-command.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10087
2024-12-17 10:13:16 -05:00
Brad King
135e6feba9 Merge topic 'find-cps'
d00201afd6 Tests: Add tests for CPS find_package
65429611b9 find_package: Fix handling of relative paths in CPS
5236984a08 Help: Describe CPS support in find_package
34828650d6 find_package: Add experimental gate for CPS support
25cc83428e find_package: Actually import .cps files
91c31ada23 find_package: Actually find .cps files
b89e43b2bc find_package: Start implementing CPS search
3e9f96079d Add additional string case functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10018
2024-12-17 10:12:24 -05:00
Timothy Finnegan
427be46424 GenEx $<PATH>: Add NATIVE_PATH sub-command.
Implements the generator expression $<PATH:MATIVE_PATH> which convert
path(s) into a native format with platform-specific slashes (``\`` on
Windows hosts and ``/`` elsewhere).

Fixes: #26515
2024-12-14 11:16:47 +01:00
Matthew Woehlke
d00201afd6 Tests: Add tests for CPS find_package
Add several tests for the new CPS support in find_package. While not
exhaustive, there is some coverage for both search and import functions.
2024-12-13 08:58:25 -05:00
Matthew Woehlke
34828650d6 find_package: Add experimental gate for CPS support 2024-12-13 08:58:24 -05:00
Matthew Woehlke
25cc83428e find_package: Actually import .cps files
Implement logic (partly adapted from the 2023 proof-of-concept) to
actually parse CPS files and generate imported targets. Implement logic
to locate and load supplemental files. Adjust prefix handling to require
that the CPS file provides sufficient information to translate the
prefix placeholder into a meaningful path. (Note that this corresponds
to a change in the specification.)
2024-12-13 08:58:24 -05:00
Matthew Woehlke
91c31ada23 find_package: Actually find .cps files
Add a helper class to read CPS files. Use this to teach find_package how
to consider and accept .cps files in its search. (Note that no version
testing is performed at this time.) Add a simple test that we can find a
package from a .cps file and correctly extract the version information.

Note that this doesn't actually import anything from CPS yet.
2024-12-13 08:58:24 -05:00
Cristiano Carvalheiro
419cfe30d0 Xcode: Support for 'LLDB Init File' scheme property
Fixes: #24002
2024-12-13 08:31:11 -05:00
Brad King
a96d6a98d3 Tests/RunCMake/XcodeProject: Improve XcodeSchemaProperty failure messages 2024-12-13 08:30:56 -05:00
Brad King
35425256a5 Merge topic 'iface-public-modules'
854eba0c53 target_sources: Improve error message for CXX_MODULES on INTERFACE libraries
cd179e7560 Tests/RunCMake/CXXModules: Rename FileSetModules cases to be more specific

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10090
2024-12-12 09:12:01 -05:00
Brad King
854eba0c53 target_sources: Improve error message for CXX_MODULES on INTERFACE libraries
We support non-compiled `SOURCES` on `INTERFACE` libraries, and also
support `CXX_MODULES` on *imported* `INTERFACE` libraries (via synthetic
targets that compile module interface units).  However, we do not
support `CXX_MODULES` on non-imported `INTERFACE` libraries because
there is no place to hold module interface unit's object files for their
module initializers.  Previously this was not explicitly rejected, and
so was diagnosed only by "CMake Internal Error" messages due to
assumption violations in the implementation.

Fixes: #26524
Co-authored-by: Ben Boeckel <ben.boeckel@kitware.com>
2024-12-11 12:34:29 -05:00
Brad King
cd179e7560 Tests/RunCMake/CXXModules: Rename FileSetModules cases to be more specific
They all add `CXX_MODULES` to `STATIC` libraries.
2024-12-11 12:20:45 -05:00
Brad King
85f4fdc000 Merge topic 'debugger-working-directory'
0a9fb88121 fileapi: Report DEBUGGER_WORKING_DIRECTORY in codemodel-v2 target objects
9ed178f9d8 Add generator-agnostic DEBUGGER_WORKING_DIRECTORY target property
200efab4d4 Tests/RunCMake/FileAPI: Improve error on unexpected line numbers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10075
2024-12-11 09:47:03 -05:00
Brad King
9f8dbcda3b Merge topic 'codegen-ninja'
5ce1ca607f Ninja: Add missing top-level codegen dependencies on per-directory codegen
5d0f2aba7e cmGlobalNinjaGenerator: Simplify per-directory configuration list lookup
505ffdcbde cmGlobalNinjaGenerator: Clarify order of codegen build statement logic
5f33736c03 cmGlobalNinjaGenerator: Fix local variable name for codegen target
e308d1bb88 cmGlobalNinjaGenerator: Remove unnecessary local variable
c08543d711 cmGlobalNinjaGenerator: Remove unused local variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10084
2024-12-11 09:42:09 -05:00
Brad King
5ce1ca607f Ninja: Add missing top-level codegen dependencies on per-directory codegen
In commit 197cb419d1 (add_custom_command: Add CODEGEN support,
2024-05-27, v3.31.0-rc1~394^2) we accidentally left out the global
`codegen` target's dependencies on the per-directory `codegen` targets.
Add them for parity with the `all` target.

Fixes: #26517
2024-12-10 11:46:31 -05:00
Brad King
ed0baf1ec5 Merge topic 'rvm_refactor'
f06b2af291 Tests/FindRuby/Rvm: Honor Ruby_FIND_VIRTUALENV ONLY
a023377b86 FindRuby: Move checking of RVM and System Ruby to separate functions.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10071
2024-12-10 09:18:31 -05:00
Brad King
90e3d69551 Merge topic 'hurd-rpath-origin'
8d2f6f0971 hurd: Fix runtime path test
0c452257e7 hurd: Add relative rpath support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10078
2024-12-10 09:17:30 -05:00
Brad King
f0a79d35df Merge topic 'swift-module-dir-genex'
4de5ef45f0 ci: Enable Swift tests in Ninja Multi-Config job on Windows
e1d635e71c Swift: Expand generator expressions in Swift_MODULE_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10062
2024-12-10 09:15:59 -05:00
Brad King
a4c706a5e6 Merge topic 'isolate-find_package-tests'
c10e1ea979 Tests: Better isolate find_package tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10080
2024-12-10 09:14:00 -05:00
Brad King
27be881b3f Merge topic 'vs-clang-cl-c++23'
30139913e9 VS: Restore support for mixing C++23 and C in one target with clang-cl
57da8712c1 VS: Factor out check for mixed C and C++ target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10082
2024-12-10 09:12:04 -05:00
Garrett Campbell
0a9fb88121 fileapi: Report DEBUGGER_WORKING_DIRECTORY in codemodel-v2 target objects
Closes: #16478
2024-12-10 09:04:31 -05:00
Brad King
30139913e9 VS: Restore support for mixing C++23 and C in one target with clang-cl
Since commit 474eafe28c (clang-cl: Add support for C++23, 2024-09-13,
v3.31.0-rc1~97^2) we use a Clang-specific flag to enable C++23 since
`clang-cl` has no `-std:c++23` flag, and `-std:c++latest` may enable an
even newer version of C++.  However, in `.vcxproj` files there is no way
to express a target-wide `-clang:-std=c++23` flag for only C++ sources
when the target also has C sources.  Add a special case to map back to
`-std:c++latest` for targets with C++23 and C together.

Fixes: #26508
2024-12-09 14:57:35 -05:00
Evan Wilde
e1d635e71c Swift: Expand generator expressions in Swift_MODULE_DIRECTORY
This patch makes the `Swift_MODULE_DIRECTORY` property behave more like
the other output directory properties, allowing generator expressions
and fixing the behavior with multi-config generators.

Issue: #26010
2024-12-09 10:37:05 -08:00
Matthew Woehlke
c10e1ea979 Tests: Better isolate find_package tests
Tweak find_package test to turn off as much searching of the host
environment as possible. This should make the tests less likely to be
affected in case the host system happens to have a package with the same
name as one of the test packages.
2024-12-09 10:52:55 -05:00
cfis
f06b2af291 Tests/FindRuby/Rvm: Honor Ruby_FIND_VIRTUALENV ONLY 2024-12-09 10:15:52 -05:00
Brad King
8c53b0be2a Merge topic 'xcode-embed-frameworks'
0282429c5a Xcode: Fix XCODE_EMBED_FRAMEWORKS when settings differ across targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9985
2024-12-09 09:56:10 -05:00
Samuel Thibault
8d2f6f0971 hurd: Fix runtime path test 2024-12-09 10:25:20 +01:00
Brad King
200efab4d4 Tests/RunCMake/FileAPI: Improve error on unexpected line numbers 2024-12-06 18:05:20 -05:00
Aleksei Sapitskii
0282429c5a Xcode: Fix XCODE_EMBED_FRAMEWORKS when settings differ across targets
In commit 5651901c54 (Xcode: add support for embedding frameworks,
2020-10-24, v3.20.0-rc1~402^2) we incorrectly reused `PBXBuildFile`
instances when the same framework is embedded in multiple targets,
causing target-specific settings to conflict.

Fixes: #26438
2024-12-06 09:22:07 -05:00
Brad King
c8f6197e09 Merge topic 'fix-test-clicolor'
3a01e2005e Tests: Unset CLICOLOR[_FORCE]

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !10070
2024-12-05 08:17:55 -05:00
Brad King
ef26f74442 Merge topic 'autogen-revert-ui-rebuild'
debc4d3906 Autogen: Revert adding ui files to byproducts of the timestamp target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10056
2024-12-05 08:10:36 -05:00
Brad King
4d4d7b793d Merge topic 'autogen-revert-ui-rebuild' into release-3.31
debc4d3906 Autogen: Revert adding ui files to byproducts of the timestamp target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10056
2024-12-05 08:10:35 -05:00
Matthew Woehlke
3a01e2005e Tests: Unset CLICOLOR[_FORCE]
Ensure that the CLICOLOR[_FORCE] environment variables are not set when
running CMake's tests, as they cause especially RunCMake tests to
produce output that doesn't match the test expectations, resulting in
spurious test failures.
2024-12-04 15:02:04 -05:00
Brad King
3993dc4214 Merge branch 'backport-linker-prefix-crash' into linker-prefix-crash 2024-12-04 10:21:32 -05:00
Brad King
76f4fc7dd0 LINK_OPTIONS: Fix crash on empty LINKER: prefix
Since commit e3895f4a8b (Linking: Preserve nested LINKER: prefixes as
written, 2024-09-17, v3.31.0-rc1~60^2) we may increment an iterator past
the end.  Revise logic to avoid that.

Fixes: #26499
2024-12-04 10:16:56 -05:00
Brad King
39b96cb0d9 Merge topic 'vs-WindowsKernelModeDriver'
2709f07b4d VS: Add minimal support for Windows Kernel Mode Drivers
fec276e632 cmVisualStudio10TargetGenerator: Use inline member initialization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10042
2024-12-04 08:52:56 -05:00
Orkun Tokdemir
debc4d3906 Autogen: Revert adding ui files to byproducts of the timestamp target
When `ui_` include directives have different paths than `CMakeLists.txt`,
the dependency graph is not generated correctly.  This is the root cause
of #16776.  However, when #26135 was fixed by commit 5363bebc1e (Autogen:
Fix compilation of unchanged source files, 2024-07-16, v3.31.0-rc1~328^2),
it made #16776 worse: the build is always dirty.  Revert the fix for now.

Fixes: #26485
Issue: #26135
Issue: #25436
2024-12-04 12:37:13 +01:00
Joseph Snyder
2709f07b4d VS: Add minimal support for Windows Kernel Mode Drivers
Extend the experimental support for `WindowsKernelModeDriver` to the
Visual Studio generators.  Hard-code some settings for now.
2024-12-03 14:18:52 -05:00
Brad King
b1ab297d07 Merge topic 'FindPython-SABIModule-handling'
ff65c5fca0 FindPython: Ensure SABIModule is found in all cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10058
2024-12-03 09:04:42 -05:00
Marc Chevrier
ff65c5fca0 FindPython: Ensure SABIModule is found in all cases
Fixes: #26493
2024-12-02 17:37:18 +01:00
Brad King
8a2cdc6ada Merge topic 'normalize-input-paths'
08040ced86 cmake: Look up on-disk case of input paths on macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10020
2024-12-02 10:04:55 -05:00
YunQiang Su
08040ced86 cmake: Look up on-disk case of input paths on macOS
Follow up commit 1a6015e5fc (PathResolver: Add helper to compute
normalized paths, 2024-10-30) to cover on-disk case lookup on macOS.

Fixes: #26333
2024-12-01 07:12:51 -05:00
Brad King
7f830c58a4 Merge topic 'ci-vs-i18n'
cc626365ca ci: Add VS 2022 nightly job in path with international characters
7b5d692165 Tests/RunCMake/ctest_build: Fix check script for i18n characters in path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10046
2024-11-30 07:23:53 -05:00
Brad King
5aebb62d0c Merge topic 'autogen-ninja-multi-config'
8a526f6a44 Autogen: Fix Ninja Multi-Config dependency graph regression
3cac48e8cd Autogen: Restore <target_name>_autogen_timestamp_deps target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10039
2024-11-29 09:57:21 -05:00