Commit Graph

11691 Commits

Author SHA1 Message Date
Brad King
2fad42832d Merge topic 'aix-archive-shared-libraries-export' into release-3.31
cd6fb63093 AIX: Propagate AIX_SHARED_LIBRARY_ARCHIVE through exports

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10027
2024-11-23 15:12:49 -05:00
Brad King
cd6fb63093 AIX: Propagate AIX_SHARED_LIBRARY_ARCHIVE through exports
Teach `export()` and `install(EXPORT)` to record this setting on the
imported targets they generate.  Make this property's non-presence
authoritative on imported targets since they represent what was built
elsewhere.
2024-11-21 19:02:00 -05:00
Brad King
f923463f2b AIX: Disallow TARGET_SONAME_* genex for AIX_SHARED_LIBRARY_ARCHIVE targets
AIX shared library archives have no filesystem artifact named with their
SONAME because it is in an archive.
2024-11-21 18:44:25 -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
Craig Scott
9a24c1e802 GoogleTest: Clear script content buffer on flush and flush less often
There's no need to check if flushing is needed after every command
is added to the variable holding the script content. It is enough to only
check once per test name. This simplifies the flushing logic, removing
the need for a separate flush_script() command. Previously, we were
not clearing the flushed script contents in all cases, but this is now
rigorously enforced at the one location where flushing is performed.

Also simplify the flushing of the list of test names, since that too doesn't
need a separate command. It is simpler and safer to handle that
directly inline where the one call to flush_tests_buffer() was
previously being made.

Fixes: #26431
2024-11-12 10:22:21 -05: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
92272c4a17 Tests/RunCMake/BuildDepends: Skip LinkDepends with broken GNU ld 2.43
Issue: #26401
2024-10-26 06:01:09 -04:00
Brad King
be540dbe19 Tests: Fix FILE stream leaks in helper programs 2024-10-26 05:47:19 -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
6fdb15672d Tests: Update FindBoost.TestPython for Python 3.13 and 3.14
Follow up the python 3.13 and 3.14 support from:

* commit be958c8f35 (FindPython: Add support for Python 3.14, 2024-10-17)
* commit dfab044c44 (FindPython: add support for Python 3.13, 2023-08-14)

with an update for the FindBoost test.
2024-10-25 08:43:05 -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
Brad King
34067963cc LFortran: Improve detection of implicit link information for lfortran 0.40+
These versions of LFortran support passing `-v -Wl,-v` to the underlying
compiler so we can extract the full implicit link information.

Issue: #26145
2024-10-24 11:15:12 -04:00
Matthew Woehlke
630e4a12a3 Help: Fix find_package search order w.r.t. globs
Add documentation to clarify that `find_package` searches paths in the
specified order and stops at the first match.  Clarify documentation of
`CMAKE_FIND_PACKAGE_SORT_*` to match the actual behavior.

Note that no behavior is actually changed, this merely improves the
documentation to reflect actual behavior rather than seeming to imply
something else.

Also, update the test to verify that what we claim in the updated
documentation is what's actually happening.
2024-10-23 12:46:07 -04:00
Brad King
ceda8bece9 Merge topic 'test-cuda-bin2c-null' into release-3.31
0c1d290090 Tests: Ensure CUDA bin2c output is null terminated

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9917
2024-10-19 14:49:47 -04:00
Robert Maynard
0c1d290090 Tests: Ensure CUDA bin2c output is null terminated
The default behavior of bin2c is to create binary arrays that have no
null termination.  So to use it as a C array we need to explicitly tell
it to create valid null terminated strings.

This will safely allow us to run PTX tests across all CUDA drivers.
2024-10-18 11:05:10 -04:00
Brad King
5a459163dc Merge topic 'fix-cps-version' into release-3.31
f04dd93c47 cmExportPackageInfoGenerator: Fix version properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9914
2024-10-18 07:40:14 -04:00
Brad King
e45dc7b827 Merge topic 'test-cuda-simplify-kernels' into release-3.31
ee9e2216ec Tests: Simplify CUDA kernels avoid crash with nvidia driver 550

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9913
2024-10-18 07:35:57 -04:00
Robert Maynard
ee9e2216ec Tests: Simplify CUDA kernels avoid crash with nvidia driver 550
Avoid having two identical kernels in PTX.  We don't need a second
kernel anyway.
2024-10-17 20:18:24 -04: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
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
645b57b8cd Tests/RunCMake/CMP0156: Match expected results more precisely 2024-10-16 16:49:27 -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
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
51eb713098 Merge topic 'FindOpenMP-CUDA-Clang'
a4b60d948d FindOpenMP: Add support for CUDA when compiling with Clang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9886
2024-10-08 08:49:03 -04:00
Brad King
f93640b4c0 Merge topic 'test-cuda-optixir-includes'
c75e873564 CUDA: OptiXIR test includes all required headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9884
2024-10-08 08:47:02 -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
Brad King
a4b60d948d FindOpenMP: Add support for CUDA when compiling with Clang 2024-10-07 14:19:08 -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
Robert Maynard
c75e873564 CUDA: OptiXIR test includes all required headers 2024-10-07 10:23:42 -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
Brad King
9a14348a2c Merge topic 'GoogleTest-DISCOVERY_EXTRA_ARGS'
2dcba446e2 GoogleTest: Add DISCOVERY_EXTRA_ARGS to gtest_discover_tests()
f55f9fd5c1 Help: Mention TEST_LIST with gtest_discover_tests() can omit tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9856
2024-10-07 09:10:44 -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
Cedric Martineau
2dcba446e2 GoogleTest: Add DISCOVERY_EXTRA_ARGS to gtest_discover_tests()
Fixes: #26261
Co-authored-by: Craig Scott <craig.scott@crascit.com>
2024-10-04 18:12:30 +10: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
9e3b559b6a Tests: Update cmake_minimum_required versions to 3.10 2024-10-03 14:18:16 -04:00
Brad King
f4aa34daa7 Tests/RunCMake: Update cmake_minimum_required versions to 3.10
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.10 where possible.
2024-10-03 11:52:22 -04:00
Brad King
1d38d52995 Tests/RunCMake: Match diagnostic line numbers more robustly 2024-10-03 10:23:37 -04:00
Marc Chevrier
cd418d4bb6 Static libraries de-duplication: keep first occurrence
Fixes: #26335
2024-10-02 10:17:08 -04:00
Brad King
9b5c805bf6 Tests/RunCMake/LinkLibrariesStrategy: Check ordering results more strongly 2024-10-02 10:16:15 -04:00
Brad King
823e0a3a61 Merge topic 'preserve-empty-args-test-command-lines'
fc7aa3cd69 tests: Preserve empty arguments in test command lines
9f1703530b Help: Add pre-test to prose for gtest_discover_tests()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9575
2024-10-02 08:11:57 -04:00
Craig Scott
fc7aa3cd69 tests: Preserve empty arguments in test command lines
This will now preserve empty values in the TEST_LAUNCHER and
CROSSCOMPILING_EMULATOR target properties for tests added by:

- The add_test() command.
- The ExternalData_Add_Test() command from the ExternalData module.
- The gtest_add_tests() or gtest_discover_tests() commands from the
  GoogleTest module.

For the gtest_add_tests() and gtest_discover_tests() commands,
empty elements in the values passed after the EXTRA_ARGS keyword
are also now preserved.

Policy CMP0178 is added to provide backward compatibility with the
old behavior where empty values were silently discarded from the
above cases.

Fixes: #26337
2024-10-02 10:09:11 +10:00
Darragh Coy
55831faf5b VS: Honor VS_TOOL_OVERRIDE for known source file types too
Visual Studio Generator: The `VS_TOOL_OVERRIDE` source file property
would previously only be respected for file types that CMake didn't know
how to build out of the box. This change allows the user to override how
any source file is built with a custom build tool, even ones with
standard/recognized extensions such as `.cxx`, `.idl`, etc.

Fixes: #26336
2024-10-01 14:00:00 -04:00
Brad King
80d16018fa Merge topic 'FindOpenMP-CUDA'
8f4cea94da FindOpenMP: Add support for CUDA when supported by the toolchain
f8ed4d7c21 FindOpenMP: Factor out compiler id lookup
534923428a FindOpenMP: Simplify compiler driver check
42bf0f596e FindOpenMP: Simplify explicit "omp" library checks
5204262c0e ci: add libomp to cuda12.2 base image

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9861
2024-09-30 09:56:45 -04:00
Brad King
98402581f4 Merge topic 'aix-archive-shared-libraries'
6c12e0758b Ninja: Fix AIX shared library archiving

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9857
2024-09-30 09:48:21 -04:00