Commit Graph

37578 Commits

Author SHA1 Message Date
Brad King 72f4659697 Merge topic 'xcode-library-link-flags'
a2414480e8 cmGlobalXCodeGenerator: Remove unused argument from LookupFlags helper
35317a7ae2 Xcode: De-duplicate -dynamiclib/-bundle flags for SHARED/MODULE libraries
5fdd4a5859 cmGlobalXCodeGenerator: Convert GetTargetProductType signature to string_view
ced6b31c48 cmGlobalXCodeGenerator: Convert CreateString signature to string_view

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10862
2025-06-09 09:26:01 -04:00
Kitware Robot 5ecd2acf75 CMake Nightly Date Stamp 2025-06-09 00:04:54 -04:00
Kitware Robot 5b7c38550b CMake Nightly Date Stamp 2025-06-08 00:11:01 -04:00
Brad King a2414480e8 cmGlobalXCodeGenerator: Remove unused argument from LookupFlags helper 2025-06-07 06:43:08 -04:00
Brad King 35317a7ae2 Xcode: De-duplicate -dynamiclib/-bundle flags for SHARED/MODULE libraries
Xcode automatically adds a flag matching the generated `LIBRARY_STYLE`:

* For SHARED libraries we've been duplicating `-dynamiclib` with a copy
  in `CMAKE_SHARED_LIBRARY_CREATE_<LANG>_FLAGS`.  Remove it for Xcode.

* For MODULE libraries we've been not duplicating `-bundle` only by accident.
  Since commit 586a9427d3 (ENH: Created target property INSTALL_NAME_DIR...,
  2006-02-24, v2.4.0~418) we've looked up `CMAKE_<LANG>_LINK_FLAGS`, meant
  for EXECUTABLEs, instead of `CMAKE_SHARED_MODULE_CREATE_<LANG>_FLAGS`.
  Switch to the latter, but remove `-bundle` for Xcode.
2025-06-07 06:43:08 -04:00
Brad King 5fdd4a5859 cmGlobalXCodeGenerator: Convert GetTargetProductType signature to string_view 2025-06-07 06:42:56 -04:00
Brad King ced6b31c48 cmGlobalXCodeGenerator: Convert CreateString signature to string_view 2025-06-07 06:36:49 -04:00
Kitware Robot 0bc1e556c9 CMake Nightly Date Stamp 2025-06-07 00:04:34 -04:00
Brad King 7fbd43c84c Merge topic 'cps-more-metadata'
da97747dac CPS: Support additional metadata
f224e131a5 CPS: Refactor metadata handling
7155903e53 cmExportPackageInfoGenerator: Fix style

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10856
2025-06-06 08:28:25 -04:00
Brad King 91690cac34 Merge topic 'msvc-link-machine'
92d6126450 MSVC: Move link -machine flag out of CMAKE_*_LINKER_FLAGS
bb8baacbcc MSVC: Factor out link -machine flag name
4c6c7f4d45 MSVC: Move link -subsystem flag handling near and -machine flag handling
f1a80a5581 CUDA: Drop unused link rule variable setting on Windows
a0732ce47f CMAKE_STATIC_LINKER_FLAGS: Fix terminology in cache entry help string
53aab8acd6 Tests: Generalize test name RunCMake.MSVC{Warning => Default}Flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10849
2025-06-06 08:19:54 -04:00
Kitware Robot 2121f65c67 CMake Nightly Date Stamp 2025-06-06 00:04:45 -04:00
Brad King 39da8f69a1 Merge topic 'update-kwsys'
4578775280 Merge branch 'upstream-KWSys' into update-kwsys
0792fe05f6 KWSys 2025-06-05 (9953c411)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10861
2025-06-05 10:32:18 -04:00
Brad King 4578775280 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-06-05 (9953c411)
2025-06-05 10:06:37 -04:00
Brad King 430f0b2729 Merge topic 'cpack-deb-control-file-syntax'
865f0032eb CPack/DEB: Remove extra newline at the end of .deb control file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10853
2025-06-05 09:40:22 -04:00
Brad King 92d6126450 MSVC: Move link -machine flag out of CMAKE_*_LINKER_FLAGS
The `CMAKE_{EXE,SHARED,MODULE,STATIC}_LINKER_FLAGS` variables are
not language-specific, so multiple languages' toolchains may disagree
about if/how to pass the flag through a compiler driver to the linker.
Furthermore, carrying the flag in public-facing variables allows projects
or users to change it even though it is required.  Add policy CMP0197
to remove the flag from the public-facing variables and generate it
automatically instead:

* For command-line generators, add the `-machine:` flag to the
  linker and archiver rule variables.

* For Visual Studio generators, we do not need to explicitly add the
  link `-machine:` flag.  MSBuild automatically adds it, and the new
  behavior actually removes a duplicate we generated previously.

Issue: #21934
2025-06-05 09:16:54 -04:00
Kitware Robot afd2ee9d33 CMake Nightly Date Stamp 2025-06-05 00:04:20 -04:00
Roberto Benfatto 865f0032eb CPack/DEB: Remove extra newline at the end of .deb control file
It effectively created a control file with two stanzas when package file
data is appended, one of which lacks required parameters, making this
package impossible to use in a package repository.

Fixes: #26975
2025-06-04 11:30:51 -04:00
Brad King 727103ed9c Merge topic 'vs-Zc-defaults'
7db3dbddb2 VS: Suppress MSBuild default flags not specified by project or user

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10851
2025-06-04 11:22:26 -04:00
Brad King e25b99a4af Merge topic 'ninja-create_def-directory'
2ec61ed01d Ninja: Fix WINDOWS_EXPORT_ALL_SYMBOLS with PRE_LINK build event

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10844
2025-06-04 11:15:32 -04:00
Kitware Robot d761b0ee9c CMake Nightly Date Stamp 2025-06-04 00:04:56 -04:00
Matthew Woehlke da97747dac CPS: Support additional metadata
Add support for specifying CPS's supplemental `description` and
`website` attributes. Add ability to inherit these from the `project()`,
similar to how version information can be inherited.
2025-06-03 16:50:46 -04:00
Matthew Woehlke f224e131a5 CPS: Refactor metadata handling
Add some helper functions to simplify some repetitive code dealing with
CPS metadata. The duplication isn't bad now, but in the future we will
be handling additional properties that will benefit from these helpers.
2025-06-03 16:50:46 -04:00
Matthew Woehlke 7155903e53 cmExportPackageInfoGenerator: Fix style
Use PascalCase for cmExportPackageInfoGenerator's local helper function.
2025-06-03 16:34:31 -04:00
Vince Dupuis 2ec61ed01d Ninja: Fix WINDOWS_EXPORT_ALL_SYMBOLS with PRE_LINK build event
Previously the `__create_def` command could fail in cases where a
`PRE_LINK` custom command changes the working directory.

Fixes: #26973
2025-06-03 11:10:45 -04:00
Brad King 7dbffb3aa1 Merge topic 'cps-metadata-from-project'
ecf81c1bc1 CPS: Get metadata from project
9adf93d112 Tests/InstallPackageInfo: Consolidate bad arguments tests
d4ab279742 cmState: Track known projects
0ccbe5a2e1 CPS: Refactor argument parsing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10837
2025-06-03 07:57:23 -04:00
Kitware Robot cd2d4276c3 CMake Nightly Date Stamp 2025-06-03 00:04:30 -04:00
Brad King 7db3dbddb2 VS: Suppress MSBuild default flags not specified by project or user
`Microsoft.Cl.Common.props` adds some `cl` flags by default, but for
CMake they may not match what's produced by command-line generators.
If the `-Zc:wchar_t`, `-Zc:forScope`, and/or `-Zc:inline` flags are
not specified by the project or user, suppress them.

Fixes: #26964
2025-06-02 14:59:38 -04:00
Matthew Woehlke ecf81c1bc1 CPS: Get metadata from project
Modify {export,install}(PACKAGE_INFO) commands to inherit version
information from the current project in situations where it seems
reasonable to do so. Add an option to explicitly request inheritance
from a specific project.

This leverages the recently added project(COMPAT_VERSION).
2025-06-02 10:31:36 -04:00
Matthew Woehlke d4ab279742 cmState: Track known projects
Add a member to directory state that records the set of known projects.
Add a method to query whether a project exists.

Internally, while this doesn't allow us to confirm that a variable like
`foo_VERSION` is actually associated with a project `foo`, it provides a
much stronger indicator than the mere existence of said variable.
2025-06-02 10:31:35 -04:00
Matthew Woehlke 0ccbe5a2e1 CPS: Refactor argument parsing
CPS package metadata involves a fair amount of passing around a
particular set of values, as well as shared argument handling, which is
only going to increase as additional features are added. In order to
reduce code duplication (now and going forward), create a helper class
to handle the shared argument parsing and to serve as a container to
pass metadata values.
2025-06-02 10:31:35 -04:00
Brad King 81bcc806d3 Merge topic 'allow-assigning-argument-helpers'
5eec48ee40 cmArgumentParser: Simplify assignment of marker types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10845
2025-06-02 09:18:38 -04:00
Brad King 91cdfe6676 Merge topic 'linker-launcher'
cdf2a36f48 HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER
77312cc636 CUDA: Add support for [CMAKE_]CUDA_LINKER_LAUNCHER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10847
2025-06-02 09:02:46 -04:00
Kitware Robot 45670ce4de CMake Nightly Date Stamp 2025-06-02 00:07:13 -04:00
Kitware Robot 14ba99b5d5 CMake Nightly Date Stamp 2025-06-01 00:04:21 -04:00
Kitware Robot 747f4713dd CMake Nightly Date Stamp 2025-05-31 00:04:34 -04:00
Matthew Woehlke 5eec48ee40 cmArgumentParser: Simplify assignment of marker types
Explicitly allow argument markers to be assigned. Make use of this in
parsing. This simplifies working with these types, by allowing them to
be assigned from the underlying types using simple `a = b` syntax,
rather than requiring gymnastics to access the underlying assignment
operations. It also makes assignment more consistent with
initialization.
2025-05-30 11:10:41 -04:00
Maximilian Sander cdf2a36f48 HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, CUDA, OBJC, OBJCXX, and Fortran.  Add HIP.

Closes: #26967
2025-05-30 10:05:46 -04:00
Maximilian Sander 77312cc636 CUDA: Add support for [CMAKE_]CUDA_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, OBJC, OBJCXX, and Fortran.  Add CUDA.

Issue: #26967
2025-05-30 10:00:18 -04:00
Kitware Robot ab5866c2d2 CMake Nightly Date Stamp 2025-05-30 00:04:41 -04:00
Brad King c3b2e5b444 Merge topic 'fix-project-COMPAT_VERSION'
09701440d9 project: Fix handling of COMPAT_VERSION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10838
2025-05-29 10:13:11 -04:00
Brad King 1c8fa92921 Merge topic 'windows-module-def-per-lang'
8b710d8264 Linker: Generate per-language module -DEF: flags on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Markus Mützel <markus.muetzel@gmx.de>
Merge-request: !10836
2025-05-29 10:11:13 -04:00
Brad King 975b78d0eb Merge topic 'remove-CMakeDetermineVSServicePack'
39da33ae81 CMakeDetermineVSServicePack: Add policy to remove this module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10834
2025-05-29 10:07:44 -04:00
Kitware Robot df894a11b3 CMake Nightly Date Stamp 2025-05-29 00:04:53 -04:00
Matthew Woehlke 09701440d9 project: Fix handling of COMPAT_VERSION
In cmProjectCommand, after validating the VERSION, we move it into a
local variable. Later, however, we were comparing COMPAT_VERSION against
the VERSION stored in the arguments. Compare to the local variable
instead.
2025-05-28 14:28:51 -04:00
Brad King 8b710d8264 Linker: Generate per-language module -DEF: flags on Windows
With IntelLLVM on Windows, we link using the compiler driver.
With MSVC on Windows, we invoke the linker directly.  If we
use both in a single build tree, for separate languages,
the value of `CMAKE_LINK_DEF_FILE_FLAG` conflicts.  Add a
per-language `CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable to
avoid the conflict.  Preserve the language-agnostic variable
for compatibility with projects that reference it.

Fixes: #26005
2025-05-28 13:48:26 -04:00
Brad King 39da33ae81 CMakeDetermineVSServicePack: Add policy to remove this module
It has been documented as deprecated since CMake 3.0.
2025-05-28 09:47:06 -04:00
Brad King bc9785a12b Merge topic 'linker-launcher'
d176a8c5ce Fortran: Add support for [CMAKE_]Fortran_LINKER_LAUNCHER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10831
2025-05-28 09:17:17 -04:00
Brad King 3bc68185b1 Merge topic 'cpack-DragNDrop-leaks'
07d9e9b5fe CPack/DragNDrop: Release CoreFoundation objects after they are used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10830
2025-05-28 09:15:50 -04:00
Brad King 68f49d73bb Merge topic 'cpack-DragNDrop-crash'
bbc98fb67a CPack/DragNDrop: Avoid crash when locale identifier creation fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10829
2025-05-28 09:14:14 -04:00
Kitware Robot 40c8ad97ff CMake Nightly Date Stamp 2025-05-28 00:04:28 -04:00