Commit Graph

36652 Commits

Author SHA1 Message Date
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
Matthew Woehlke b89e43b2bc find_package: Start implementing CPS search
Teach find_package to search CPS search paths, and to look for CPS file
names. Modify the set of file names to also include the file type (CPS
or CMake-script). Modify the search function to allow specifying which
file type(s) to consider.

During full path search, each possible path is searched for only one of
the two possible file types. However, subsequent runs, or when
considering a user-specified path (<name>_DIR), CMake will look for both
file types.

Note that this only adds the new path search logic as described above;
CMake does not yet know how to read CPS files, and there is a high
likelihood that Bad Things will happen if it tries. However, this seemed
like a good place to checkpoint.
2024-12-13 08:58:24 -05:00
Matthew Woehlke 3e9f96079d Add additional string case functions
Add function to perform case-insensitive comparison of two string-view
instancess. Add functions to perform case conversion on string_view.
2024-12-13 08:58:23 -05:00
Brad King fe7b414916 Merge topic 'normalize-input-paths'
592e95bbea cmFindPackageCommand: Avoid temporarily saving non-existent result
8d6b76771d find_package: Explicitly normalize CONFIG file path as it exists on disk

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10096
2024-12-13 08:57:19 -05:00
Brad King d82de042c7 Merge topic 'update-kwsys'
6309e298bc Merge branch 'upstream-KWSys' into update-kwsys
8884161843 KWSys 2024-12-12 (60c63c1f)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10097
2024-12-13 08:56:30 -05:00
Kitware Robot d30bbe5c3f CMake Nightly Date Stamp 2024-12-13 00:01:12 -05:00
Brad King 6309e298bc Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2024-12-12 (60c63c1f)
2024-12-12 12:52:51 -05:00
Brad King 592e95bbea cmFindPackageCommand: Avoid temporarily saving non-existent result 2024-12-12 11:38:29 -05:00
Brad King 8d6b76771d find_package: Explicitly normalize CONFIG file path as it exists on disk
This was missed in commit 9d44a77454 (find_*: Explicitly normalize found
paths as they exist on disk, 2024-10-17).
2024-12-12 11:36:40 -05:00
Brad King f4428d9784 Merge topic 'refactor-ostream-usage'
c225897ca0 cmExportCMakeConfigGenerator: Optimize `std::ostream::operator<<` calls
bdece1c754 Refactor: Optimize `ostream::operator<<()` calls for some generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10079
2024-12-12 09:16:04 -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 1c04068a8d Merge topic 'install-DESTINATION-regression'
92e63421cb install: Restore treatment of DESTINATION as a single-valued keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10088
2024-12-12 09:01:19 -05:00
Kitware Robot dd913e9edc CMake Nightly Date Stamp 2024-12-12 00:01:15 -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
Alex Turbov c225897ca0 cmExportCMakeConfigGenerator: Optimize std::ostream::operator<< calls 2024-12-11 19:40:45 +04:00
Alex Turbov bdece1c754 Refactor: Optimize ostream::operator<<() calls for some generators 2024-12-11 19:40:41 +04:00
Brad King 77ae9d7585 Merge topic 'codegen-make'
25b43a5b7f Makefile: Enable progress messages for codegen target
af2b340a2e Makefile: Fix per-directory codegen target
b7e6c418e3 cmLocalUnixMakefileGenerator3: Simplify progress command generation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10085
2024-12-11 10:10:03 -05:00
Craig Scott 92e63421cb install: Restore treatment of DESTINATION as a single-valued keyword
The `install(RUNTIME_DEPENDENCY_SET)` form processes its arguments in a
slightly different way to other forms of the command. It handles the
`POST_...`, `PRE_...` and `DIRECTORIES` keywords separately. These
keywords are not visible to the first layer of keyword processing, so
they don't terminate multi-value keyword value parsing.

Before commit 6a1fac1450 (install: Normalize DESTINATION paths,
2024-09-18, v3.31.0-rc1~73^2), the `DESTINATION` keyword was handled as
a simple string value. That commit changed it to use a function so it
could process the value before storing it, but the function returned the
wrong value. This meant it was treated as a multi-value keyword instead
of a single-value keyword.

Fixes: #26512
2024-12-11 09:58:39 -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 f51d6aee2f Merge topic 'android-native'
f3ecddbaa2 cmAffinity: Fix compilation in native Android builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10083
2024-12-11 09:45:31 -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
Kitware Robot 4b99073192 CMake Nightly Date Stamp 2024-12-11 00:01:31 -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 5d0f2aba7e cmGlobalNinjaGenerator: Simplify per-directory configuration list lookup 2024-12-10 11:41:27 -05:00
Brad King 505ffdcbde cmGlobalNinjaGenerator: Clarify order of codegen build statement logic
Make it more consistent with the equivalent logic for "all".
2024-12-10 11:41:27 -05:00
Brad King 5f33736c03 cmGlobalNinjaGenerator: Fix local variable name for codegen target 2024-12-10 11:41:26 -05:00
Brad King e308d1bb88 cmGlobalNinjaGenerator: Remove unnecessary local variable 2024-12-10 11:41:26 -05:00
Brad King c08543d711 cmGlobalNinjaGenerator: Remove unused local variable 2024-12-10 11:41:26 -05:00
Brad King 25b43a5b7f Makefile: Enable progress messages for codegen target
This was left out of commit 197cb419d1 (add_custom_command: Add CODEGEN
support, 2024-05-27, v3.31.0-rc1~394^2).
2024-12-10 11:36:29 -05:00
Brad King af2b340a2e Makefile: Fix per-directory codegen target
Issue: #26517
2024-12-10 11:36:29 -05:00
Brad King b7e6c418e3 cmLocalUnixMakefileGenerator3: Simplify progress command generation 2024-12-10 11:36:29 -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 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 f3ecddbaa2 cmAffinity: Fix compilation in native Android builds
Fixes: #26516
2024-12-10 08:44:08 -05:00
Kitware Robot a2c30a4eeb CMake Nightly Date Stamp 2024-12-10 00:01:29 -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
Brad King 57da8712c1 VS: Factor out check for mixed C and C++ target 2024-12-09 14:19:51 -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
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
Brad King 41cd84174a Merge topic 'makefile-stack-manipulation'
dcaa52c6c3 PrintCallStack: "Fix" entry suppression
a73955ae76 cmMakefile: Allow arbitrary stack manipulation
de5700a15a cmMakefile: Prevent copying RAII helpers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10067
2024-12-09 10:00:52 -05:00
Brad King b66c010033 Merge topic 'refactor-find_package'
e2a6416622 find_package: Refactor in support of recursion
bd542748af find_package: Use map::emplace instead of make_pair

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10054
2024-12-09 09:59:00 -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
Kitware Robot 29302e11bb CMake Nightly Date Stamp 2024-12-09 00:01:29 -05:00
Kitware Robot 175b74ed0a CMake Nightly Date Stamp 2024-12-08 00:01:39 -05:00
Matthew Woehlke dcaa52c6c3 PrintCallStack: "Fix" entry suppression
Backtraces may contain non-specific entries (n.b. FromListFilePath in
cmListFileContext). Our prior expectation is that these will ALWAYS
replaced by more specific entries. However, with the previous change to
allow users to create arbitrary stack entries, this is no longer the
case. Modify PrintCallStack to only skip printing these non-specific
entries if they were in fact preceded by a more specific entry.

This, and the functionality of the preceding commit, is intended to be
used for CPS dependency resolution. Because said resolution may fail at
a non-trivial depth, it is important to be able to provide the user with
the path of packages that led to the failure. However, because this
happens through parsing JSON, there is no listfile function to associate
with the stack entries, nor do we attempt to keep track of line numbers
from the JSON. As a result, these entries will never be more specific
than the name of the CPS file whose dependencies we are trying to
locate.
2024-12-07 09:12:54 -05:00
Matthew Woehlke a73955ae76 cmMakefile: Allow arbitrary stack manipulation
Create a helper class to allow insertion of arbitrary entries into the
call stack (i.e. not associated with ExecuteCommand, ReadDependentFile,
etc.). Refactor ExecuteCommand helper class to leverage this and to be
named more consistently with similar helpers.
2024-12-07 09:11:45 -05:00
Kitware Robot a5e5064844 CMake Nightly Date Stamp 2024-12-07 00:01:10 -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
Kitware Robot 3d535b0969 CMake Nightly Date Stamp 2024-12-06 00:01:13 -05:00