36251 Commits

Author SHA1 Message Date
Brad King
eb281d3454 CMake 3.31.1 2024-11-21 11:15:52 -05:00
Brad King
82aaccc576 Merge topic 'execute_process-OUTPUT_FILE-cloexec' into release-3.31
60af429c5d execute_process: Restore CLOEXEC on OUTPUT_FILE and ERROR_FILE descriptors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Bertrand Bellenot <bertrand.bellenot@cern.ch>
Merge-request: !10014
2024-11-21 08:24:18 -05:00
Brad King
60af429c5d execute_process: Restore CLOEXEC on OUTPUT_FILE and ERROR_FILE descriptors
Since commit 5420639a8d (cmExecuteProcessCommand: Replace cmsysProcess
with cmUVProcessChain, 2023-06-01, v3.28.0-rc1~138^2~8), the descriptors
for the `OUTPUT_FILE` and `ERROR_FILE` leak to child processes.

With `ExternalProject` + `INSTALL_COMMAND` + `LOG_INSTALL`, the logging
wrapper script leaks the log files' descriptors to the native build
tool.  If they happen to match the `make` job server's pipe fds, e.g.,
with GNU `make` <= 4.3, then the build fails with an error like:

    gmake[4]: *** read jobs pipe: Bad file descriptor.  Stop.

Fixes: #26398
2024-11-20 06:16:11 -05:00
Matthew Woehlke
71784bb6d8 cmExperimental: Make CPS-export experimental notice more consistent
There is an inadvertent inconsistency in the notice for the CPS export
experimental feature as compared to other experimental feature notices.
Change it to be consistent.
2024-11-19 17:40:06 -05:00
Marc Chevrier
0445190d2f LLD linker: avoid regression on archive libraries deduplication
Due to a bug on LLD linker for ELF binaries, deduplication should
occur only if CMP0156 and CMP0179 are NEW.

Fixes: #26447
2024-11-18 21:02:50 +01:00
Craig Scott
62586f236c CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)
Fixes: #26449
2024-11-16 10:02:01 +11:00
Brad King
4c4f173876 Clarify advice given by compatibility deprecation message for CMake < 3.10
Since commit 84db8506ff (Deprecate compatibility with CMake versions older
than 3.10, 2024-10-03, v3.31.0-rc1~23^2) the `cmake_minimum_required` and
`cmake_policy` commands warn if the project does not enable policies as
of 3.10 or higher.  Clarify the advice given in the warning message about
how to update the version specification, particularly without actually
requiring a newer minimum version of CMake.
2024-11-14 09:40:01 -05:00
Brad King
e22c8383b9 CMake 3.31.0 2024-11-06 08:41:37 -05:00
Brad King
356e3adc71 CMake 3.31.0-rc3 2024-10-29 10:18:41 -04:00
Craig Scott
c8567acc32 cmake_parse_arguments: Restore capture of value after repeated keyword
When a single-value keyword is repeated, and the first instance is
missing a value, it prevents the value from the second instance from
being stored in a variable. This was a regression introduced by
commit ceeea4e511 (cmake_parse_arguments: Set variable if empty string
given after keyword, 2024-08-18). That change also didn't create a
variable if the keyword was given but without a value. The purpose
of the change was to always define a variable if a keyword was given.
Lastly, that change didn't protect the CMP0174 logic to make it only
apply to the PARSE_ARGV form.

The first two of the above problems are fixed here by tracking the
keywords given instead of checking which keywords were missing
values. The third problem is also fixed here, being tightly coupled
to the same logic as the first two problems.

Fixes: #26397
2024-10-28 09:47:21 -04:00
Brad King
f42962bfbf Merge topic 'link-strategy' into release-3.31
39fd396421 LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !9949
2024-10-28 09:14:39 -04:00
Brad King
5c7a55edc2 cmStringAlgorithms: Fix core.NonNullParamChecker diagnostic in cmAlphaNum 2024-10-26 06:01:09 -04:00
Brad King
51ed0eba18 KWSys: SystemInformation: Add missing EOF check when reading /proc/cpuinfo
Backport KWSys upstream commit `6e847d08b` (SystemInformation: Add
missing EOF check when reading /proc/cpuinfo, 2024-10-23) to the
CMake 3.31 release branch.
2024-10-26 06:01:09 -04:00
Brad King
39fd396421 LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations
Since commit 7abd3137b7 (Linking: Optionally reorder direct dependencies
from LINK_LIBRARIES, 2024-09-19, v3.31.0-rc1~53^2) the strategy name
`PRESERVE_ORDER` has led users to expect that it strictly preserves
order.  While the part of the link line generation logic controlled by
`LINK_LIBRARIES_STRATEGY` does preserve order, it is not the last step.
Toolchain-specific de-duplication can cause the order to change on the
actual link line generated in the build system.

Rename the strategies:

* `PRESERVE_ORDER` => `REORDER_MINIMALLY`
* `REORDER`        => `REORDER_FREELY`

The new names make it clear that reordering is always possible, just to
varying degrees.  Update the `LINK_LIBRARIES_STRATEGY` documentation to
clarify that the strategies do not directly control the final link line.

Fixes: #26400
Issue: #26271
2024-10-25 10:23:37 -04:00
Brad King
7605228f5e codespell: Fix typos 2024-10-25 08:43:04 -04:00
Brad King
ebd038613e Merge topic 'windows-kernel-mode-driver' into release-3.31
54bbd00448 WindowsKernelModeDriver: Switch to appending to variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9941
2024-10-25 08:21:32 -04:00
Joseph Snyder
54bbd00448 WindowsKernelModeDriver: Switch to appending to variables
When using the WindowsKernelModeDriver, do not add the new paths
if the variable was not previously defined.  Instead, append them
to the existing value.

Add a new GUID for the Experimental mode gate
2024-10-24 13:20:08 -04:00
Marc Chevrier
0619c064ff Linker configuration: enhance usability
The linker configuration file is now optional: It is loaded only if
variable CMAKE_<LANG>_USE_LINKER_CONFIGURATION is set to TRUE.

The file CMakeAddNewLanguage.txt is updated to take into account the
linker configuration.

Fixes: #26393
2024-10-24 16:37:30 +02:00
Matthew Woehlke
f04dd93c47 cmExportPackageInfoGenerator: Fix version properties
Fix a small bug in cmExportPackageInfoGenerator that caused extended
version properties ("compat_version", "version_schema")) to be emitted
when empty. Add a test to ensure this is working as intended.

Fixes: #26264
2024-10-17 14:57:38 -04:00
Brad King
773eff6d8e CMake 3.31.0-rc2 2024-10-17 09:01:08 -04:00
Brad King
262c277197 Revert "Ensure imported targets in sibling dirs are deduplicated"
Revert commit 502610733f (Ensure imported targets in sibling dirs are
deduplicated, 2024-09-15, v3.31.0-rc1~92^2).  Also revert the change
from a copy of the logic made by commit cd418d4bb6 (Static libraries
de-duplication: keep first occurrence, 2024-09-29, v3.31.0-rc1~30^2).
The logic was de-duplicating based on the target name rather than based
on the library file path.

Fixes: #26371
Issue: #26284
2024-10-16 16:49:27 -04:00
Brad King
093a9dac38 Merge topic 'vs-fortran-ipo' into release-3.31
a36df0220f VS: Honor INTERPROCEDURAL_OPTIMIZATION for Fortran targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9899
2024-10-15 10:31:00 -04:00
Pavel Liavonau
a36df0220f VS: Honor INTERPROCEDURAL_OPTIMIZATION for Fortran targets
Also map `-Qipo` to its `.vfproj` attribute.

Fixes: #26361
2024-10-14 10:17:12 -04:00
Aditya Vidyadhar Kamath
dc8e4f8f0c AIX: Enable versioned shared objects with CMAKE_AIX_SHARED_LIBRARY_ARCHIVE
Closes: #26358
2024-10-10 14:00:59 -04:00
Brad King
7fb05af311 cmGeneratorTarget: Simplify AIX shared library archive name computation 2024-10-10 13:18:01 -04:00
Brad King
e12e5e0566 cmGeneratorTarget: Simplify ComputeVersionedName signature 2024-10-10 13:10:13 -04:00
Brad King
3dcb06e956 CMake 3.31.0-rc1 2024-10-10 09:39:31 -04:00
Brad King
b062c18c64 Begin 3.31 release versioning 2024-10-09 10:02:30 -04:00
Brad King
a71652496a Merge topic 'project-vars-policy'
e5a9ccbcc8 project: Always set <PROJECT-NAME>_* as normal variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9879
2024-10-09 09:20:57 -04:00
Kitware Robot
5d58adf282 CMake Nightly Date Stamp 2024-10-09 00:01:23 -04:00
Craig Scott
e5a9ccbcc8 project: Always set <PROJECT-NAME>_* as normal variables
Re-introduce the behavior originally introduced in CMake 3.30.3 by
commit c1ece78d11 (project: non cache <project> prefix variables are
also created, 2024-08-27, v3.30.3~2^2), but this time with a policy for
compatibility.

Issue: #25714
Issue: #26243
2024-10-08 10:07:11 -04:00
Brad King
dc371e07fb Merge topic 'project-vars'
fa07ddfebf project: Only check non-cache vars when setting project vars

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9883
2024-10-08 08:45:26 -04:00
Kitware Robot
1de987a7e9 CMake Nightly Date Stamp 2024-10-08 00:01:12 -04:00
Craig Scott
fa07ddfebf project: Only check non-cache vars when setting project vars
The change in commit 86ad7cc886 (project: Only define non-cache vars if
already defined, 2024-09-15, v3.30.4~2^2) was meant to only check for
non-cache variables when deciding whether to set non-cache project
variables for the current call.  However, it erroneously checked for any
variable, including cache variables.  This gives the intended result on
the first run, but on subsequent runs a cache variable will exist that
did not on the first run, leading to different behavior between the two
runs.  Fix the logic to only check for a pre-existing non-cache
variable, as was originally intended.

Fixes: #26355
2024-10-07 10:24:37 -04:00
Brad King
5b7ab1818b Merge topic 'cmake--workflow-preset'
b80aa1d3a3 preset: Easier command line interface for Workflow Presets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9866
2024-10-07 09:11:48 -04:00
Kitware Robot
2086ddf27e CMake Nightly Date Stamp 2024-10-07 00:02:40 -04:00
Kitware Robot
943fd14320 CMake Nightly Date Stamp 2024-10-06 00:02:00 -04:00
Kevin Tolle
b80aa1d3a3 preset: Easier command line interface for Workflow Presets
A positional option allows 'cmake --workflow --preset <preset>' to be
shortened to 'cmake --workflow <preset>'.

Fixes: #26270
2024-10-05 16:08:44 +10:00
Kitware Robot
581be8a0fd CMake Nightly Date Stamp 2024-10-05 00:01:32 -04:00
Brad King
d734f8dc6d Merge topic 'deprecate-pre-3.10'
84db8506ff Deprecate compatibility with CMake versions older than 3.10
9e3b559b6a Tests: Update cmake_minimum_required versions to 3.10
f4aa34daa7 Tests/RunCMake: Update cmake_minimum_required versions to 3.10
1d38d52995 Tests/RunCMake: Match diagnostic line numbers more robustly
55778f5a16 ExternalProject: Enable all policies in internal scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9875
2024-10-04 10:26:23 -04:00
Kitware Robot
f296e7c85b CMake Nightly Date Stamp 2024-10-04 00:01:20 -04:00
Brad King
84db8506ff Deprecate compatibility with CMake versions older than 3.10
Issue a deprecation warning on calls to `cmake_minimum_required` or
`cmake_policy` that set policies based on versions older than 3.10.
Note that the effective policy version includes `...<max>` treatment.
Update the check from commit 3a4791548d (Deprecate compatibility with
CMake versions older than 3.5, 2023-02-09, v3.27.0-rc1~508^2).
2024-10-03 14:18:26 -04:00
Brad King
951122dd56 Merge topic 'aix-rpath-padding'
3e5b9229e0 AIX: Fix XCOFF editor to avoid duplicating standard libpath entries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9865
2024-10-03 08:10:27 -04:00
Brad King
e78ae03893 Merge topic 'cmake-host-executable-suffix'
5d2b89d5fa Add CMAKE_HOST_EXECUTABLE_SUFFIX for Unix/Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: shiz01 <shiz01@tutanota.com>
Merge-request: !9863
2024-10-03 08:07:39 -04:00
Brad King
1ee630e06f Merge topic 'static-libraries-deduplication'
cd418d4bb6 Static libraries de-duplication: keep first occurrence
9b5c805bf6 Tests/RunCMake/LinkLibrariesStrategy: Check ordering results more strongly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9864
2024-10-03 08:06:39 -04:00
Brad King
31db1a047e Merge topic 'ctest-sp-recursion'
f3dcbfaa8c CTest: Avoid infinite recursion with -SP option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9870
2024-10-03 08:05:11 -04:00
Kitware Robot
6849604dd2 CMake Nightly Date Stamp 2024-10-03 00:01:18 -04:00
leha-bot
5d2b89d5fa Add CMAKE_HOST_EXECUTABLE_SUFFIX for Unix/Windows
Closes: #17553
2024-10-02 10:39:40 -04:00
Marc Chevrier
cd418d4bb6 Static libraries de-duplication: keep first occurrence
Fixes: #26335
2024-10-02 10:17:08 -04:00
Aditya Vidyadhar Kamath
3e5b9229e0 AIX: Fix XCOFF editor to avoid duplicating standard libpath entries
The `/usr/lib` and `/lib` entries need to be present, but do not need to
be at the end.  Avoid appending extra copies of the entries if they
already exist.

Closes: #26275
2024-10-02 08:48:32 -04:00