Commit Graph
16228 Commits
Author SHA1 Message Date
Brad King 18fac8b212 Merge topic 'compiler-binutils'
047c617a77 Modules/Compiler: Prefer companion tools adjacent to compiler
ccf42522b8 Modules/Compiler: Improve formatting of code finding companion tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !12510
2026-09-18 08:09:00 -04:00
Brad King 047c617a77 Modules/Compiler: Prefer companion tools adjacent to compiler
Previously a versioned name in a later search path was preferred
over an unversioned name adjacent to the compiler.  Consider all
names in each directory before moving to the next directory.
2026-09-15 08:46:25 -04:00
Brad King ccf42522b8 Modules/Compiler: Improve formatting of code finding companion tools 2026-09-15 08:43:43 -04:00
Brad King 246e72e4a9 Help: Replace OpenBLAS links with their permanent redirects 2026-09-15 08:23:58 -04:00
Craig Scott d410092ece FetchContent: Move log level detection into step script
A step with a custom command shouldn't be seen as out-of-date
just because the user re-runs configure with a different log level.
Previously, the log level was written directly to the step scripts,
but that meant the script changes if the user specifies a different
effective log level to the previous configure. Now we move the
log level detection into the script so that the script remains the
same no matter what log level the user asks for.

This was most noticeable with the PATCH step, since that always
uses a custom command when present. Changing the log level
would cause the PATCH step to re-run, which usually results in
an error because PATCH typically only expects to run once after
a DOWNLOAD. But the underlying problem would affect any step
with a custom command, not just PATCH.

Fixes: #28055
2026-09-13 21:23:27 +10:00
Brad King 4b2cf13e42 Merge topic 'findpkgconfig-l-colon'
0cc8f00e6b FindPkgConfig: support GNU ld -l:<file> exact-file syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12485
2026-09-09 13:25:27 -04:00
Brad King ad9bc7bf17 Merge topic 'blas-lapack-nvpl'
d8ade0500e Find{BLAS,LAPACK}: Provide full paths in `{BLAS,LAPACK}_LIBRARIES` with NVPL
cdf4234bc4 Find{BLAS,LAPACK}: Only search for the needed components of NVPL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12484
2026-09-09 13:23:29 -04:00
Brad King 171d3120de Merge topic 'doc-blas-lapack-libraries'
b2feea6f38 Find{BLAS,LAPACK}: Document intended usage of `_LIBRARIES` more precisely

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12491
2026-09-08 09:57:18 -04:00
Brad King 9f69b22d30 Merge topic 'FindBLAS-mkl-fortran'
7fc5446d66 FindBLAS: Fix MKL Fortran API selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12479
2026-09-08 09:55:59 -04:00
Brad King fd80f621a5 Merge topic 'FindBLAS-mkl-threading'
f49e24f150 FindBLAS: Select MKL threading layer based on the OpenMP runtime library
e4a3ef7f8b FindBLAS: Select Intel MKL Fortran ABI and threading runtime independently

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12480
2026-09-08 09:51:21 -04:00
Ye Luo d8ade0500e Find{BLAS,LAPACK}: Provide full paths in {BLAS,LAPACK}_LIBRARIES with NVPL
Documentation as of CMake 4.4.3 states that these variables provide full
paths to libraries, so some existing consumers expect it.

NVPL provides imported targets that set `IMPORTED_LOCATION_RELEASE`.

Fixes: #28073
2026-09-07 12:37:49 -04:00
Ye Luo cdf4234bc4 Find{BLAS,LAPACK}: Only search for the needed components of NVPL 2026-09-07 12:37:49 -04:00
15daksh-2003 0cc8f00e6b FindPkgConfig: support GNU ld -l:<file> exact-file syntax
Some .pc files (e.g. DPDK) use -l:libfoo.a for an exact library file, but
we passed the colon to find_library and it never resolved. Strip it for
lookup, keep the token so an unresolved lib still falls back to -l:.

Fixes: #27452
2026-09-07 21:28:11 +05:30
Brad King b2feea6f38 Find{BLAS,LAPACK}: Document intended usage of _LIBRARIES more precisely
Remove the outdated promise of absolute paths in `_LIBRARIES`.
The "using full path name" phrasing was left from before imported
targets were a thing.

Issue: #28073
2026-09-07 11:20:04 -04:00
Ye Luo f49e24f150 FindBLAS: Select MKL threading layer based on the OpenMP runtime library
Fixes: #28072
2026-09-07 10:39:21 -04:00
Ye Luo 7fc5446d66 FindBLAS: Fix MKL Fortran API selection
Fixes: #28071
2026-09-07 10:35:54 -04:00
Ye Luo e4a3ef7f8b FindBLAS: Select Intel MKL Fortran ABI and threading runtime independently 2026-09-07 10:30:34 -04:00
Brad King 61a5b7846b Merge topic 'clang-cuda-offload-linker'
5b416cbe77 ci: add job testing cuda13.2 with clang
64dac60df9 ci: Update cuda13.2-x86_64 base image to clang-23
ce3d0af576 Clang/CUDA: Support the llvm23+ offload linker model

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12052
2026-09-07 08:45:35 -04:00
Brad King 67a9fda3f1 Merge topic 'implicit-link-info-separated-l-flag'
8eb3e61e5c CMakeParseImplicitLinkInfo: Fix parsing of -l flags with separated value

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12477
2026-09-07 08:43:55 -04:00
Robert Maynard ce3d0af576 Clang/CUDA: Support the llvm23+ offload linker model
Fixes: #26120, #26810
2026-09-03 13:26:45 -04:00
Jacob Lambert 64a4a0c9a8 HIP: Detect default architecture from the AMDGPU subarch triple
Otherwise, `project(LANGUAGES HIP)` fails to configure on a machine
with no AMD GPU when using Clang 22 or newer:

  Failed to find a default HIP architecture.

The default architecture is determined by running `rocm_agent_enumerator`,
which returns nothing when no GPU is present, and then by matching
` -target-cpu ([a-z0-9]+) ` in the compiler's cc1 output.  Clang stopped
passing `-target-cpu` for AMDGPU in LLVM/Clang commit bf9fe776748c
(clang/AMDGPU: Stop passing redundant -target-cpu to cc1, 2026-08-31);
the processor is now carried in the triple's subarch field.  Neither
path matches, so configuration fails.

Fall back to reading the subarch out of the triple, e.g.,
`amdgpu9.06-amd-amdhsa` for `gfx906`.  Keep the `-target-cpu` branch for
older compilers.  Generic targets spell the subarch with fewer
components, e.g., `amdgpu10.3--` for `gfx10-3-generic`.  Those are not
matched, so they still reach the existing error rather than producing an
invalid architecture name.
2026-09-03 12:05:25 -04:00
Brad King 8eb3e61e5c CMakeParseImplicitLinkInfo: Fix parsing of -l flags with separated value
`clang-linker-wrapper` prints `-l cudadevrt` instead of `-lcudadevrt`.
We already handle this for `-L` flags.
2026-09-02 15:45:04 -04:00
Brad King 981f5b5f71 Merge topic 'clang-arm64x'
ea378e104d Windows: Detect both ARM64 and ARM64EC with Clang -marm64x flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12464
2026-09-02 09:16:19 -04:00
Brad King ea378e104d Windows: Detect both ARM64 and ARM64EC with Clang -marm64x flag
Both architectures appear in object files, so add both of them to
`CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID` too.  We already do this for
multiple `CMAKE_OSX_ARCHITECTURES` on Apple platforms.

Fixes: #28067
2026-09-01 17:47:27 -04:00
Brad King 417fed9562 MinGW: Fix implicit link info detection with spaces in toolchain path
The `gcc -v -Wl,-v` debug output does not quote or escape spaces, so
`separate_arguments(... NATIVE_COMMAND ...)` separates on spaces in
paths.  Separate on ` -L` and ` -l` instead.

Fixes: #28056
2026-09-01 14:55:01 -04:00
Brad King baec7315b5 CMakeParseImplicitLinkInfo: Avoid using GCC's "Configured with" line
The `gcc -v` output includes a "Configured with" line about its own
build environment.  Use it only for the fallback from commit 78b7ba6494
(LinkerId: Fix detection of linker tool for GNU on SunOS sparc32,
2023-12-19, v3.29.0-rc1~176^2~8).
2026-09-01 14:42:46 -04:00
Brad King 8e49148617 Merge topic 'llvmflang-compile-warn-error'
32c8a4bd01 LLVMFlang: Add support for COMPILE_WARNING_AS_ERROR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12455
2026-09-01 10:41:59 -04:00
scivision 32c8a4bd01 LLVMFlang: Add support for COMPILE_WARNING_AS_ERROR
LLVM/Flang has supported `-Werror` since version 13.
2026-08-31 12:05:01 -04:00
Brad King a13db261f6 Merge topic 'cpack-nsis-exe-dir'
6b695daab8 CPack/NSIS: Fix PATH modification without "bin" directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12449
2026-08-31 11:40:40 -04:00
Brad King ab498e7cad Merge topic 'revert-googletest-discovery'
5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
c0ef680605 GoogleTest: Avoid else after return

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12448
2026-08-31 11:01:11 -04:00
Pedro López-Cabanillas 6b695daab8 CPack/NSIS: Fix PATH modification without "bin" directory
Previously our NSIS project template hard-coded `$INSTDIR\bin` for
inclusion in the `PATH`.  If the directory does not exist, nothing is
done.  Use `CPACK_NSIS_EXECUTABLES_DIRECTORY` instead of `bin`.

Fixes: #15635
2026-08-28 11:18:18 -04:00
Daniel Pfeifer 5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
Revert commit a324c2bb58 (GoogleTest: Base on builtin command
discover_tests, 2026-03-01, v4.4.0-rc1~30^2).  The `discover_tests`
implementation does not persist already-discovered tests across ctest
runs, making it much slower on projects whose test binaries take a while
just to start up and list tests.  Revert to the prior implementation
pending caching support in `discover_tests`.

Fixes: #28053
Issue: #28060
2026-08-28 11:08:59 -04:00
Daniel Pfeifer c0ef680605 GoogleTest: Avoid else after return
Commit c3c95f3010 (GoogleTest: Avoid generation error on duplicate
target test discovery, 2026-07-14, v4.4.1~24^2) has added a level of
indentation which made rebasing other changes harder than necessary.
Avoiding an else branch after a return command allows keeping the
original indentation.
2026-08-28 10:21:52 -04:00
Brad King 8337f4e670 Merge topic 'ibm-flang-fix'
fbe5bcb7d3 IBMFlang: Rename compiler modules from IBMLLVMFlang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12443
2026-08-27 10:50:27 -04:00
Brad King 47c0fd1977 Merge topic 'GNUInstallDirs-no-lang'
78b4ffa0a7 GNUInutallDirs: Suppress LIBDIR warning for LANGUAGES NONE projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12440
2026-08-27 10:45:01 -04:00
Brad King ba0f16f6cb Merge topic 'ewilde/ninja-refactor-swift-builds'
23b33482f1 Swift: Refactor module / object builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12438
2026-08-27 10:36:55 -04:00
Kelvin Li fbe5bcb7d3 IBMFlang: Rename compiler modules from IBMLLVMFlang
These were missed in commit 4969297469 (IBMFlang: Rename compiler id
from IBMLLVMFlang, 2026-06-09, v4.4.0-rc1~7^2).
2026-08-26 16:36:13 -04:00
rewine 78b4ffa0a7 GNUInutallDirs: Suppress LIBDIR warning for LANGUAGES NONE projects
Projects that explicitly use LANGUAGES NONE, e.g. to install only
data files, have no target architecture, which is intentional.
Default to `lib` without warning.

Fixes: #23461
2026-08-26 09:38:33 -04:00
Brad King 10b4bf7e1e Merge topic 'flang-fortran-system-includes'
5d2974974b Flang: Do not use -isystem with classic flang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12436
2026-08-26 09:24:06 -04:00
Zhiqiang Chen 5d2974974b Flang: Do not use -isystem with classic flang
Extend commit a8e7a1047a (GNU: Do not use -isystem with gfortran,
2015-03-26, v3.3.0-rc1~292^2) to cover classic Flang too.  It does
not search system include directories for Fortran `.mod` files.
2026-08-25 14:06:59 -04:00
Brad King 072038c191 Merge topic 'aix-gnu-no-lto'
cff46f99ee AIX: Disable LTO/IPO with GCC, which does not support it

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12430
2026-08-25 10:41:48 -04:00
Aditya Kamath cff46f99ee AIX: Disable LTO/IPO with GCC, which does not support it
The GNU compiler does not support LTO on AIX.
2026-08-24 13:52:21 -04:00
Brad King 92c31a16c0 Merge topic 'link-library-needed-library-linux'
a2e6306c27 GenEx/LINK_LIBRARY: Add NEEDED_LIBRARY support on Linux
158b64688f Linker/GNU: Refactor LINKER_PUSHPOP_STATE_SUPPORTED check to a function
0f784069c3 Tests: Consolidate RunCMake.target_link_libraries-LINK_LIBRARY conditions
6491bd5a5f Help: Format LINK_LIBRARY NEEDED_LIBRARY platforms as a definition list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12410
2026-08-24 12:14:51 -04:00
Evan Wilde 23b33482f1 Swift: Refactor module / object builds
Splitting up the computation of common variables, module build
variables, and object build variables to make it a little easier to
focus on each one.

Updated tests to reflect updated flag order and updated object-build
description.
2026-08-14 17:02:20 -07:00
Brad King ca0ed0f66f Merge topic 'swift-cmp0215-update'
e4a37fbf15 Tests/RunCMake/Swift: Add CMP0195 behavior checks
b7a78568c3 CMP0215: Update NEW behavior to require CMP0157/CMP0195 to be NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12407
2026-08-14 06:30:36 -04:00
Robert Maynard a2e6306c27 GenEx/LINK_LIBRARY: Add NEEDED_LIBRARY support on Linux 2026-08-13 13:45:19 -04:00
Robert Maynard 158b64688f Linker/GNU: Refactor LINKER_PUSHPOP_STATE_SUPPORTED check to a function 2026-08-13 13:45:19 -04:00
Evan Wilde b7a78568c3 CMP0215: Update NEW behavior to require CMP0157/CMP0195 to be NEW
Update CMP0215 to avoid attempting to iterate through the flags
looking for `-emit-module-path` ins the user-specified flags. We don't
do this anywhere else in the code. The existing implementation didn't
handle correctly parsing the flag so `-I blah/my-emit-module-path/` and
`-Xcc -emit-module-path ...` would both trigger it, result in the
compiler not emitting any module. Furthermore, it didn't include the
user-specified module path as part of the build graph resulting in an
incorrect build graph that would never resolve.

The only two appropriate layouts for the module are either the flat
binary module file with the name `<module-name>.swiftmodule`, or the
nested form with
`<module-name>.swiftmodule/<module-triple>.swiftmodule`. The noted
Swift-Syntax situation passes the explicit `-emit-module-path` to get to
the latter form. This form is automatically emitted by CMake when
CMP0195 is `NEW`, removing the need for the flag. The Swift project
generally recommends the nested directory structure since it gathers all
of the generated interface outputs from the compiler (textual swift
interfaces, swiftdoc, sourceinfo, and the binary swiftmodule file) in a
single place, and since it uses the module triple in the filename,
cleanly allows fat mach-o binaries on Apple platforms.

Fixes: #28021
2026-08-13 10:14:16 -04:00
Brad King 3d5f989836 Merge topic 'clang-cl-absolute-source-path'
68491cedcf clang-cl: Fix C++ module scanning when cross-compiling from Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12389
2026-08-12 11:47:02 -04:00
Brad King f27e315222 Merge topic 'clang-cl-absolute-source-path' into release-4.4
68491cedcf clang-cl: Fix C++ module scanning when cross-compiling from Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12389
2026-08-12 11:47:00 -04:00