Commit Graph

14469 Commits

Author SHA1 Message Date
Brad King
abbe8e860d Merge topic 'various-refactorings'
8352a2d12f cmFileCommand.cxx: Optimize `cmStrCat()` calls
e2c9bb7f54 cmFindBase.cxx: Optimize `cmStrCat()` calls
16a1fa9e35 cmFindBase.cxx: Check `DebugMode` and exit early to reduce indentation
6751b3d9b4 cmLocalGenerator.cxx: Optimize `std::ostream::operator<<()` calls
11bf70f968 FindPackageHandleStandardArgs: Remove the unneeded symbol from the message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10013
2024-11-20 09:34:21 -05:00
Brad King
68d15b17c3 Merge topic 'ExternalProject-install-jobserver'
1bdaad7573 ExternalProject: Optionally integrate 'make' job server with INSTALL_COMMAND

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10015
2024-11-20 09:33:04 -05:00
Brad King
3a483ccabe Merge topic 'pkg-config-versionadded'
c14a9c4648 Help: Correct FindPkgConfig version tags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10012
2024-11-20 09:28:26 -05:00
Brad King
1bdaad7573 ExternalProject: Optionally integrate 'make' job server with INSTALL_COMMAND
Add an `INSTALL_JOB_SERVER_AWARE` option to `ExternalProject_Add`.
When using an explicit `INSTALL_COMMAND`, the generated commands
won't use `$(MAKE)` thus failing to connect to the outer make's
job server.  Add an option enable explicit job server integration.

This is the install step's equivalent to the build step's
`BUILD_JOB_SERVER_AWARE` option added by commit bc43398e72
(ExternalProject: Enable Make Job Server with Explicit Build Command,
2023-08-09, v3.28.0-rc1~217^2).  It is useful when the external
project's installation is driven by its build system.  Note that with
Makefile generators, our default install command does use `$(MAKE)` to
connect to the outer make's job server.

Issue: #26398
2024-11-19 10:22:24 -05:00
Brad King
542c3259a3 Merge topic 'armclang-no--list'
688d9ee9c2 ARMClang: Remove orphaned linker --list option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10008
2024-11-19 10:15:38 -05:00
Brad King
af3a48a591 Merge topic 'Linux-deduplication-static-libs'
0445190d2f LLD linker: avoid regression on archive libraries deduplication

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10010
2024-11-19 10:14:42 -05:00
Alex Turbov
11bf70f968 FindPackageHandleStandardArgs: Remove the unneeded symbol from the message 2024-11-19 17:57:27 +04:00
FeRD (Frank Dana)
c14a9c4648 Help: Correct FindPkgConfig version tags
Two features in FindPkgConfig were added in a CMake version where
they were initially broken, and could only be used once the
implementation was fixed in a later version.

Previously, the docs contained a `.. versionadded` tag denoting the
version where the _broken_ implementation was introduced (its true
"version added", if we're being literal), with a comment in the
documentation source noting that the feature didn't actually work
correctly until whatever later version the comment specifies.

Since that's completely backwards, from a user perspective, reverse
the documentation so that the `.. versionadded` message shows when
the feature first worked **correctly**, with a comment noting that
support was technically introduced in an earlier version, but in a
broken/nonfunctioning state.
2024-11-19 02:23:25 -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
Daniel Brondani
688d9ee9c2 ARMClang: Remove orphaned linker --list option
Setting the `armlink --list` option without other diagnostic flags is
misleading because it produces an empty file and prevents the user from
printing diagnostics to the standard output or redirecting them to
another file.

It's unclear why the flag was added when support for ARMClang was first
added by commit 7b0abaac31 (ARMClang: Add support for Clang-based ARM
compiler, 2019-05-13, v3.15.0-rc1~111^2).

Fixes: #21538
2024-11-18 13:59:16 -05:00
Brad King
79a83ddb08 Apple: Enable linking during iOS/tvOS/visionOS/watchOS toolchain inspection
Since commit 11da882a12 (Apple: Introduce separate system name for iOS,
tvOS, and watchOS, 2018-01-15, v3.14.0-rc1~14^2~1) our toolchain
inspection steps, like ABI detection, tell `try_compile` to use a
`STATIC_LIBRARY` instead of an `EXECUTABLE`.  This was needed at the
time to avoid codesign requirements.  However, commit d3a64c4e3f (Xcode:
Explicitly turn off signing in try_compile projects, 2020-07-16,
v3.19.0-rc1~483^2) introduced a more general solution to that problem.
Restore linking during toolchain inspection so that we can detect and
identify the linker.

Suggested-by: Marc Chevrier <marc.chevrier@gmail.com>
Fixes: #26443
2024-11-14 11:06:49 -05:00
Brad King
1e0cd39460 Merge topic 'link-warning-as-error'
7907c83175 Link step: Add LINK_WARNING_AS_ERROR target property
656267c871 COMPILE_WARNING_AS_ERROR: rename methods to prepare link similar functionality

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9984
2024-11-13 09:24:36 -05:00
Brad King
fe872cc98c Merge topic 'musl-linux-any'
d8559ec92e Linux: Recognize multiarch directories for musl-linux-any

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9991
2024-11-13 09:19:25 -05:00
Brad King
6a25904983 Merge topic 'musl-linux-any' into release-3.31
d8559ec92e Linux: Recognize multiarch directories for musl-linux-any

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9991
2024-11-13 09:19:23 -05:00
Brad King
d84abc02db Merge topic 'image-magick-7'
f6c6032e22 FindImageMagick: Fix ARCH_INCLUDE_DIR detection for version 7 and newer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9990
2024-11-13 09:18:19 -05:00
Brad King
3819471e71 Merge topic 'image-magick-7' into release-3.31
f6c6032e22 FindImageMagick: Fix ARCH_INCLUDE_DIR detection for version 7 and newer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9990
2024-11-13 09:18:18 -05:00
Brad King
8d652dc191 Merge topic 'WHOLE_ARCHIVE-various-systems'
d2997ab601 Linker configuration: Add missing platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9992
2024-11-13 09:17:25 -05:00
Brad King
10f24d1d92 Merge topic 'WHOLE_ARCHIVE-various-systems' into release-3.31
d2997ab601 Linker configuration: Add missing platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9992
2024-11-13 09:17:24 -05:00
Brad King
fc5cdacb11 Merge topic 'gtest-discover-flush-duplicates'
007d7ea648 GoogleTest: Avoid extra call to set DISABLED test property in discovery
9a24c1e802 GoogleTest: Clear script content buffer on flush and flush less often

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9982
2024-11-13 09:14:38 -05:00
Brad King
7c999c19af Merge topic 'gtest-discover-flush-duplicates' into release-3.31
007d7ea648 GoogleTest: Avoid extra call to set DISABLED test property in discovery
9a24c1e802 GoogleTest: Clear script content buffer on flush and flush less often

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9982
2024-11-13 09:14:37 -05:00
Timo Röhling
d8559ec92e Linux: Recognize multiarch directories for musl-linux-any
When bootstrapping Debian for musl-linux-any, the multiarch directories
are not found due to an overly-specific regular expression.

See https://bugs.debian.org/1085507 for the original bug report.
2024-11-12 10:47:40 -05:00
Marc Chevrier
d2997ab601 Linker configuration: Add missing platforms
The following platforms were missing:
* Android
* WindowsCE, WindowsPhone, WindowsStore and WindowsKernelModeDriver

And enhance various Apple platforms support (iOS, tvOS, etc...)

Fixes: #26439
2024-11-12 16:46:54 +01:00
Timo Röhling
f6c6032e22 FindImageMagick: Fix ARCH_INCLUDE_DIR detection for version 7 and newer
The `magick-baseconfig.h` header has been moved to a different subdirectory.

See https://bugs.debian.org/1087233 for the original bug report in Debian.
2024-11-12 10:38:54 -05:00
Craig Scott
007d7ea648 GoogleTest: Avoid extra call to set DISABLED test property in discovery
For very long test names, this can noticeably reduce the size of the
generated file contents when tests are disabled. This change reduces
how far beyond the flush threshold the content can grow before being
flushed.

Issue: #26431
2024-11-12 10:22:23 -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
Brad King
b14df1b4bb Merge topic 'FindSQLite3-pkg-config'
2d228201fc Help: Guard calls to pkg_check_modules in cmake-developer(7) example
674a987898 FindSQLite3: Guard calls to pkg_check_modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9983
2024-11-12 10:16:48 -05:00
Brad King
4f0eb0a41e Merge topic 'FindSQLite3-pkg-config' into release-3.31
2d228201fc Help: Guard calls to pkg_check_modules in cmake-developer(7) example
674a987898 FindSQLite3: Guard calls to pkg_check_modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9983
2024-11-12 10:16:46 -05:00
Brad King
db250e0734 Merge topic 'FindBoost-1.86'
f941fb6c0b FindBoost: Add support for Boost 1.86

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9988
2024-11-12 10:13:32 -05:00
Brad King
20a1ee1a9d Merge topic 'FindBoost-1.86' into release-3.31
f941fb6c0b FindBoost: Add support for Boost 1.86

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9988
2024-11-12 10:13:31 -05:00
Marc Chevrier
7907c83175 Link step: Add LINK_WARNING_AS_ERROR target property
Add a way to specify, in a portable way, to raise an error for any
warning during the link step. For that purpose, define:
* CMAKE_LINK_WARNING_AS_ERROR variable
* LINK_WARNING_AS_ERROR target property

Fixes: #25343
2024-11-12 15:11:53 +01:00
Brad King
f941fb6c0b FindBoost: Add support for Boost 1.86
Update the list of known versions.

Run the command

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

to extract dependencies from the 1.86.0 source tree.
They are the same as 1.85's dependencies, so just update
the version check for warning about newer versions.

Fixes: #26433
2024-11-11 13:44:47 -05:00
Peter Kokot
674a987898 FindSQLite3: Guard calls to pkg_check_modules
This was missed in commit 25b947589a (Modules: Guard calls to
pkg_check_modules, 2024-08-07, v3.31.0-rc1~236^2).
2024-11-11 10:53:21 -05:00
Brad King
7b19531291 macOS: Do not pass any SDK/-isysroot to compilers by default
On modern macOS, compiler wrappers like `/usr/bin/cc` automatically
choose a SDK to pass via `-isysroot` to an underlying compiler from
Xcode or the CommandLineTools.  Other toolchains like Homebrew's `gcc-*`
come with a default SDK too.  Therefore, when targeting macOS, we no
longer need to choose any SDK or pass an `-isysroot` flag by default.

Update initialization of `CMAKE_OSX_SYSROOT` to be empty by default when
targeting macOS.

Fixes: #19180
2024-11-07 09:46:10 -05:00
Brad King
3b8b70fe72 macOS: Simplify logic converting CMAKE_OSX_SYSROOT to a path 2024-11-07 09:46:10 -05:00
Brad King
c55c113076 macOS: Revert finding tools inside Xcode that are not in the PATH
Since commit 03ab170fe0 (OS X: Enable command-line build without tools in
PATH, 2013-08-05, v2.8.12~111^2) we find compilers such as

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

when there is no corresponding compiler in the PATH.  However, modern
macOS versions always have `/usr/bin/cc` in the PATH, so this code path is
never taken (similarly for `make`).  Even if it were, the compilers in
Xcode cannot be used by build systems that do not add an `-isysroot` flag.
Instead, they should be used through the `/usr/bin/cc` wrapper, which
internally calls Xcode's compiler with a default `-isysroot` flag.
2024-11-07 09:46:09 -05:00
Brad King
77fcee9204 macOS: Revert "Resolve compiler in /usr/bin to that reported by Xcode xcrun"
Revert commit 1f085e11e4 (OS X: Resolve compiler in /usr/bin to that
reported by Xcode xcrun, 2015-01-03, v3.2.0-rc1~126^2~1).  The compilers
in Xcode cannot be used by build systems that do not add an `-isysroot`
flag.

Issue: #19180
2024-11-07 09:46:09 -05:00
Brad King
3f6164d9c4 Merge topic 'doc-CheckTypeSize'
b71ed8ce05 CheckTypeSize: Add code examples

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9971
2024-11-05 09:03:03 -05:00
Peter Kokot
b71ed8ce05 CheckTypeSize: Add code examples
This adds some basic examples of the `<variable>_CODE` and
`<variable>_KEYS`.
2024-11-04 10:55:11 -05:00
Peter Kokot
b76009bb5a CheckTypeSize: Document default language
When LANGUAGE keyword is not provided default language for the
check_type_size is C.
2024-11-04 10:39:16 -05:00
Philip Lorenz
ec22cf1a67 CMakeDetermineCompilerABI: Strip -pipe from compile flags
When `-pipe` is enabled, GCC passes data among its different executables
using pipes instead of temporary files.  This leads to issues when cmake
attempts to infer compiler internals via the `-v` flag as each
executable will print to `stderr` in parallel.  Avoid this by stripping
`-pipe` from the compilation flags during compiler inspection.

This extends commit d5895f50c3 (CMakeDetermineCompilerABI: Avoid failing
on warnings with -Werror, 2020-01-30, v3.17.0-rc1~32^2).
2024-10-29 13:13:08 -04:00
Brad King
86fe6dd869 Merge topic 'FindCUDAToolkit-remove-debug-message'
fb0b3d1585 FindCUDAToolkit: Remove debug message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9946
2024-10-28 09:28:01 -04:00
Brad King
fcff1dcb06 Merge topic 'FindCUDAToolkit-remove-debug-message' into release-3.31
fb0b3d1585 FindCUDAToolkit: Remove debug message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9946
2024-10-28 09:28:00 -04:00
Brad King
8779b1ad28 Merge branch 'backport-ci-fedora-41' into ci-fedora-41 2024-10-26 06:02:18 -04:00
Brad King
7605228f5e codespell: Fix typos 2024-10-25 08:43:04 -04:00
Seth R Johnson
fb0b3d1585 FindCUDAToolkit: Remove debug message
This was left accidentally by commit 587c0443cc (FindCUDAToolkit:
Support CUDA version extraction from version.json, 2023-05-02,
v3.26.4~3^2).
2024-10-25 08:32:00 -04:00
Brad King
0ba8bdb5c2 Merge topic 'doc-BUILD_TESTING'
9510820d58 Help: Document CTest module BUILD_TESTING variable
6e6e688b80 CTest: Improve formatting of documentation cmake code blocks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9927
2024-10-25 08:23:25 -04:00
Brad King
1380d0ddfa Merge topic 'windows-kernel-mode-driver'
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:33 -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
Brad King
e5be5c7706 Merge topic 'lfortran-link-info'
34067963cc LFortran: Improve detection of implicit link information for lfortran 0.40+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9939
2024-10-25 08:19:56 -04:00
Brad King
0a37acc607 Merge topic 'lfortran-link-info' into release-3.31
34067963cc LFortran: Improve detection of implicit link information for lfortran 0.40+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9939
2024-10-25 08:19:54 -04:00