Commit Graph

62411 Commits

Author SHA1 Message Date
Brad King
fe0d03b044 Help: Document that CMP0149 should be set before project()
Issue: #25413
2023-11-20 08:51:46 -05:00
Brad King
9cfff766eb CMake 3.27.8 v3.27.8 2023-11-15 08:55:18 -05:00
Brad King
bc9ca0331b Merge branch 'backport-target-objects' into release-3.27
Merge-request: !8974
2023-11-15 08:45:45 -05:00
Brad King
50fdaf8f1f cmComputeLinkInformation: Track targets named by TARGET_OBJECTS sources
Since commit b6a5382217 (Ninja: depend on language module information
files directly, 2023-02-10, v3.27.0-rc1~502^2), the return value of
`cmCommonTargetGenerator::GetLinkedTargetDirectories` must account for
linked object libraries because they may provide modules (#25112).
These were added by commit b665966933 (cmComputeLinkInformation: track
OBJECT library dependencies, 2023-07-22, v3.27.1~5^2).  However, targets
named by `$<TARGET_OBJECTS:...>` sources are also needed (#25365).

The latter were added by commit 22da18b995 (Fortran: Restore support for
TARGET_OBJECTS providing modules, 2023-10-27, v3.28.0-rc4~9^2) and
commit 035302b7e3 (cmComputeLinkDepends: also copy the target from
object link items, 2023-10-27, v3.28.0-rc4~9^2~2).  However, their
approach added link entries not actually specified by projects.  It also
incorrectly re-used `cmComputeLinkDepends::AddLinkObject` for object
library targets when it is meant for their individual object files.
These problems caused additional regressions (#25417).  Revert the
implementation parts of those commits and leave behind an assertion and
comment to help avoid the mistake in the future.  Instead, track targets
named by `$<TARGET_OBJECTS:...>` sources with a dedicated member.

Issue: #25112
Issue: #25365
Fixes: #25417
Co-authored-by: Ben Boeckel <ben.boeckel@kitware.com>
2023-11-14 14:50:08 -05:00
Brad King
0e26bd334d cmCommonTargetGenerator: Factor out GetLinkedTargetDirectories loop body
Re-use the body in multiple loops instead of allocating to combine them.
2023-11-14 13:50:13 -05:00
Brad King
8e90b95e67 Merge branch 'FindOpenMP-5.1-and-5.2' into release-3.27
Merge-request: !8965
2023-11-13 11:17:25 -05:00
Christoph Reiter
2859be7575 FindOpenMP: Add support for openmp 5.1 (llvm 17) and 5.2
llvm 17 now defaults to openmp 5.1; see LLVM commit `0c6f2f629cc0`.
It makes FindOpenMP set OPENMP_FOUND and OpenMP_C_SPEC_DATE, but not
OpenMP_C_VERSION, because it doesn't know the version mapping.
Add the spec date to the version mapping for 5.1 and 5.2 to make
things work again.
2023-11-13 10:51:40 -05:00
Brad King
257d6766c6 Merge branch 'revert-GetPrerequisites-linux-x86' into release-3.27
Merge-request: !8933
2023-11-01 09:39:44 -04:00
Brad King
139df0bc2f GetPrerequisites: Revert "Ignore relative paths printed by ldd"
Revert commit cf2ad9995a (GetPrerequisites: Ignore relative paths
printed by ldd, 2023-02-20, v3.27.0-rc1~459^2) because it regressed
existing use cases.  We will need to find another solution to the use
case motivating the change.

Fixes: #25372
2023-10-31 14:15:29 -04:00
Brad King
aa7f1416f9 Merge branch 'modules-depends-via-target-objects' into release-3.27
Merge-request: !8923
2023-10-31 09:13:25 -04:00
Ben Boeckel
22da18b995 Fortran: Restore support for TARGET_OBJECTS providing modules
Continue b665966933 (cmComputeLinkInformation: track OBJECT library
dependencies, 2023-07-22) which added explicitly listed `OBJECT`
libraries to the list of targets which the collator needs to consider.
Now also consider targets which provide objects directly to the target
via a `$<TARGET_OBJECT>` source lists.

Also add tests which use target objects directly and through an
`INTERFACE` library with target objects in its own sources.

Fixes: #25365
2023-10-30 10:06:12 -04:00
Ben Boeckel
64d9240564 cmComputeLinkInformation: skip over linking to items for object purposes
If a name is only found because it is a link entry of kind `Object`, do
not add anything to the link line.
2023-10-27 15:52:01 -04:00
Ben Boeckel
035302b7e3 cmComputeLinkDepends: also copy the target from object link items 2023-10-27 13:25:33 -04:00
Ben Boeckel
861876b936 Tests/ObjectLibrary: fix comment 2023-10-27 13:25:33 -04:00
Brad King
e298ffb3ff Merge branch 'release-3.26' into release-3.27 2023-10-12 19:06:27 -04:00
Brad King
f2d8c36969 Merge branch 'backport-curl-socks5-fix' into release-3.27
Merge-request: !8872
2023-10-12 19:06:14 -04:00
Brad King
d6c81467aa Merge branch 'backport-curl-socks5-fix' into release-3.26
Merge-request: !8872
2023-10-12 19:05:59 -04:00
Brad King
1d6fab5537 Merge branch 'release-3.26' into release-3.27 2023-10-12 19:03:42 -04:00
Brad King
244bb7b6bc Merge branch 'backport-ctest_submit-follow-redirects' into release-3.26
Merge-request: !8873
2023-10-12 19:01:53 -04:00
Brad King
701f52670f curl: Backport SOCKS5 heap buffer overflow fix from curl 8.4.0
Backport upstream curl commit `fb4415d8ae` (socks: return error if
hostname too long for remote resolve, 2023-10-11, curl-8_4_0~2) to
address CVE-2023-38545.

Issue: #25329
2023-10-12 15:54:53 -04:00
Zack Galbreath
ce661c4399 ctest: Restore support for http redirects during Submit step
After CDash PR 1519 introduced HTTP status codes greater than 200 for
various error cases, CMake commit b7c871f745 (ctest: Update ctest_submit
for CDash behavior change, 2023-07-24, v3.27.1~3^2) modified CTest's
submit handler to check the status returned by CDash and throw an error
when this status is not equal to 200.

That change had the unintended side effect of causing CTest submissions
to fail when uploading results to a URL that returns a redirect status
code (3xx).  Fix this by configuring cURL to follow the redirect.  The
status cURL reports to CTest is now 200 instead of 3xx when CDash is
located behind a redirect.

Fixes: #25159
2023-10-12 15:53:10 -04:00
Brad King
9532e1cf5b CMake 3.27.7 v3.27.7 2023-10-06 09:08:35 -04:00
Brad King
f69278850e Merge topic 'FindPostgreSQL-16' into release-3.27
25644a78de FindPostgreSQL: Add support for version 16

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8854
2023-10-03 09:27:27 -04:00
Brad King
25644a78de FindPostgreSQL: Add support for version 16
Fixes: #25292
2023-10-02 14:44:04 -04:00
Brad King
196960043d Merge topic 'doc-CMP0124' into release-3.27
55bf2a3494 Help: Document CMP0124 behavior on already-set variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8850
2023-10-02 09:00:01 -04:00
Brad King
832e88b208 Merge topic 'ctest-timeout-flag' into release-3.27
d267c128a2 ctest: Restore support for --timeout values higher than default test timeout
dd779a4bc2 Tests: Clarify RunCMake.CTestTimeout case name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8851
2023-10-02 08:57:35 -04:00
Brad King
55bf2a3494 Help: Document CMP0124 behavior on already-set variables
Improve the documentation from commit 46896d98bb (foreach(): loop
variables are only available in the loop scope, 2021-04-25,
v3.21.0-rc1~245^2) to follow policy documentation convention.

Fixes: #25224
Inspired-by: Marius Messerschmidt <marius.messerschmidt@googlemail.com>
2023-09-29 10:14:20 -04:00
Brad King
d267c128a2 ctest: Restore support for --timeout values higher than default test timeout
Since refactoring in commit 0a5aeaf302 (cmCTestRunTest: Consolidate test
timeout selection logic, 2023-05-04, v3.27.0-rc1~120^2) we accidentally
truncate `--timeout` values to ctest's default `TimeOut`.  Fix the
logic to prefer the flag whenever the `TIMEOUT` property is not set.

In combination with the prior refactoring, this also fixes a bug that
caused `--timeout` values of 10000000 seconds or more to be ignored.

Fixes: #23979
2023-09-29 09:25:01 -04:00
Brad King
dd779a4bc2 Tests: Clarify RunCMake.CTestTimeout case name 2023-09-29 08:58:15 -04:00
Brad King
dd949c77cb Merge topic 'android-clang-c++23' into release-3.27
75e9918a66 Android: Require Clang 18 for -std=c++23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !8847
2023-09-28 09:50:35 -04:00
Brad King
75e9918a66 Android: Require Clang 18 for -std=c++23
Update the Clang version checks added by

* commit eacacc70fc (Clang: use -std=c++23 for Clang 17.0+,
                     2023-05-08, v3.27.0-rc1~115^2)
* commit 0183956d30 (Clang: C++26 support,
                     2023-05-16, v3.27.0-rc1~85^2)

to account for Android NDK r26's distribution of a Clang based on a
development version of LLVM/Clang 17.0 that pre-dated addition of
these flags.

Follow the pattern from commit 12e6796b62 (Android: Do not pass
non-existent Clang -std flags, 2018-04-02, v3.12.0-rc1~284^2),
which fixed the same problem for `-std=c++17`.

Fixes: #25281
2023-09-27 12:56:49 -04:00
Brad King
d5d7fa463b Merge topic 'lint-genex-empty' into release-3.27
80df7b1745 Linting: Fix empty evaluated genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8833
2023-09-26 09:30:09 -04:00
Orkun Tokdemir
80df7b1745 Linting: Fix empty evaluated genex
Update logic added by commit 099934e313 (Add generator expression
support to static code analysis hooks, 2023-03-24, v3.27.0-rc1~261^2),
and preserved by commit 993dde925f (TargetGenerator: Factor out
generation of code check rules, 2023-05-12, v3.27.0-rc1~84^2~2), to
handle a generator expression that evaluates to the empty string.

If `<LANG>_CPPCHECK`, `<LANG>_CPPLINT`, `<LANG>_CLANG_TIDY`, or
`<LANG>_INCLUDE_WHAT_YOU_USE` are empty after evaluating generator
expressions, do not run their lints.

Fixes: #25265
2023-09-25 09:16:33 -04:00
Brad King
51b34a5483 CMake 3.27.6 v3.27.6 2023-09-20 10:33:04 -04:00
Brad King
ea3e9ba054 Merge topic 'fortran-in-custom-targets' into release-3.27
d870a47e23 Tests/FortranModules: add a test for iface Fortran sources
e3d511fb9c Tests/FortranModules: also test INTERFACE targets with Fortran sources
978b68d3bb add_custom_target: Fix regression with Fortran sources
619aca80ae Tests/FortranModules: add a test case for #25223
45513c1a69 Tests/FortranModules: move issue 25112 fix from FortranOnly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8814
2023-09-20 10:16:17 -04:00
Ben Boeckel
d870a47e23 Tests/FortranModules: add a test for iface Fortran sources
This tests that a library that doesn't compile Fortran sources but
provides one via `INTERFACE` sources works as intended.
2023-09-20 09:18:01 -04:00
Ben Boeckel
e3d511fb9c Tests/FortranModules: also test INTERFACE targets with Fortran sources 2023-09-20 09:16:59 -04:00
Ben Boeckel
978b68d3bb add_custom_target: Fix regression with Fortran sources
Since commit 74b1d6caf3 (cmComputeLinkInformation: compute link info for
module-using targets, 2023-09-05, v3.27.5~7^2) we accidentally try to
compute link information for custom targets if they have Fortran
sources.  For module dependencies, we only need to consider target types
that can compile.

Fixes: #25252
2023-09-20 09:14:58 -04:00
Ben Boeckel
619aca80ae Tests/FortranModules: add a test case for #25223 2023-09-18 19:58:49 -04:00
Ben Boeckel
45513c1a69 Tests/FortranModules: move issue 25112 fix from FortranOnly
It involves modules, so it belongs in the `FortranModules` test set.
2023-09-18 19:41:47 -04:00
Brad King
7d3b4868d0 CMake 3.27.5 v3.27.5 2023-09-14 13:13:14 -04:00
Brad King
01f97f93c8 Merge topic 'cxxmodules-non-compiled-source' into release-3.27
458e3974a8 cxxmodules: detect and message about non-compiled sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8773
2023-09-14 13:01:20 -04:00
Brad King
1608b0be49 Merge topic 'automoc-macro-names' into release-3.27
42adf3cba8 Autogen: Evaluate INTERFACE_AUTOMOC_MACRO_NAMES efficiently

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8799
2023-09-13 08:41:10 -04:00
Ben Boeckel
458e3974a8 cxxmodules: detect and message about non-compiled sources
Previously an internal error was raised which ended up causing an
internal exception to be thrown. This is a typo situation that should
fall into an explicit error.

Fixes: #25207
2023-09-12 14:46:36 -04:00
Brad King
42adf3cba8 Autogen: Evaluate INTERFACE_AUTOMOC_MACRO_NAMES efficiently
In commit c5c3aff1f5 (Autogen: Add INTERFACE_AUTOMOC_MACRO_NAMES target
property, 2023-04-03, v3.27.0-rc1~197^2) we forgot to mark the property
as a usage requirement.  This is needed for efficient evaluation over
the target dependency closure.

Fixes: #25238
2023-09-12 14:02:23 -04:00
Brad King
6f8746e27c Merge topic 'vs-cuda-object-libs' into release-3.27
6ebff6ebf8 VS: Avoid unnecessary CUDA device linking for OBJECT libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8794
2023-09-12 09:06:14 -04:00
Brad King
a159c2d3cf Merge topic 'FindBoost-1.83' into release-3.27
897a149067 FindBoost: Add support for Boost 1.83

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8793
2023-09-12 07:54:59 -04:00
Brad King
d2062ecc84 Merge topic 'FortranCInterface-macos-deployment-target' into release-3.27
84a097f038 FortranCInterface: forward `CMAKE_OSX_DEPLOYMENT_TARGET`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8790
2023-09-12 07:53:43 -04:00
Robert Maynard
6ebff6ebf8 VS: Avoid unnecessary CUDA device linking for OBJECT libraries
Without `CudaLink` fields, MSBuild tries to perform a device link step
for object libraries with CUDA_SEPARABLE_COMPILATION on them even when
not needed.  This commonly was encountered when generating PTX or
OPTIX-IR output.
2023-09-11 16:49:35 -04:00
Brad King
897a149067 FindBoost: Add support for Boost 1.83
Update the list of known versions.

Run the command

    cmake -DBOOST_DIR=/path/to/boost_1_83_0 \
      -P Utilities/Scripts/BoostScanDeps.cmake

to extract dependencies from the 1.83.0 source tree.

Dependencies differ from 1.82, as mentioned in the 1.83 release notes:

* Boost.Timer no longer depends on Boost.Chrono

Fixes: #25243
2023-09-11 09:54:49 -04:00