16233 Commits
Author SHA1 Message Date
Brad King 01b4728ae1 Merge topic 'CheckLanguage-timeout'
eb33b390e4 CheckLanguage: Avoid hanging forever on interactive popups

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12533
2026-09-23 13:42:33 -04:00
Julien Marrec eb33b390e4 CheckLanguage: Avoid hanging forever on interactive popups
Fixes: #28101
2026-09-22 11:47:26 -04:00
Brad King d37a1fc335 Merge topic 'automoc-predefs-msvc'
7c3ca57b91 MSVC,Clang: Set CMAKE_CXX_COMPILER_PREDEFINES_COMMAND for the MSVC ABI
0fd711348c Autogen: Pass WIN32 to moc when targeting the MSVC ABI
4a4a654814 Autogen: Keep stderr out of the generated moc_predefs.h
1c1258ad95 cmWorkerPool: Allow capturing process stderr separately

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12517
2026-09-22 10:14:46 -04:00
Taylor Braun-JonesandTyler Yankee 5cced02b9d CTest: Repeat test fixtures with the tests that require them
When ctest repeats tests with its --repeat option, it repeats each test
on its own.  A fixture's setup and cleanup tests therefore run all of
their repetitions back to back, and the tests they bracket repeat inside
a single setup/cleanup pair:

  setup -> setup -> test -> test -> cleanup -> cleanup

Add a FIXTURE_REPEAT_MODE test property to select how a fixture behaves
when its tests are repeated:

* AROUND_ALL_REPEATS: the fixture runs once, around all repetitions of
  the tests requiring it.
* AROUND_EACH_REPEAT: the fixture and the tests requiring it repeat
  together, so every repetition gets a fresh setup and its own cleanup.
* EACH_TEST_SEPARATELY: every test repeats on its own, as before.

The property describes the fixture rather than the test carrying it, so
setting it on any one of a fixture's setup or cleanup tests is enough.

In AROUND_EACH_REPEAT mode the tests of a fixture form a repeat group that
ctest re-queues as a whole once every test in it has finished.  The --repeat
condition then applies to the group the way it applies to an individual
test: until-fail repeats while the whole group passes, until-pass repeats
while any of it does not, and after-timeout repeats while any of it times
out.  Fixtures that share a test repeat together, so a test requiring two of
them still runs once per repetition.

A group is recorded the way a repeating test is: only once it stops
repeating, and with the results of its last repetition.  A group that
until-pass makes pass therefore reports a pass rather than the failure that
made it repeat, a test that DEPENDS on one of the group's tests waits for
the last repetition rather than the first, and `ctest -F` resumes an
interrupted group by running it again from the beginning.

Fixtures that repeat together have to agree on the mode: a test cannot
repeat with one fixture but not with another it takes part in, and a fixture
whose setup and cleanup tests disagree has no coherent behavior.  Report an
error and run nothing in those cases rather than pick an order in which a
test repeats after a fixture it requires has been cleaned up.

Add policy CMP0224 to select AROUND_EACH_REPEAT as the default for fixtures
whose setup and cleanup tests choose no mode themselves.  Record the mode
the policy chose in the generated test file under its own
_CMAKE_DEFAULT_FIXTURE_REPEAT_MODE keyword, so that ctest reads a mode
rather than the policy settings behind it, and so that a mode requested on
one of a fixture's tests wins over the default recorded for its siblings.
Only NEW needs recording: with nothing recorded, ctest already uses the
behavior of CMake 4.4 and below.  Fixtures are common, and the choice of
mode matters only to those who run ctest --repeat, so warn about the unset
policy only when the CMAKE_POLICY_WARNING_CMP0224 variable asks for it.

discover_tests() and gtest_discover_tests() create their tests while ctest
runs or at build time, too late for the policy to reach them, so carry the
setting in effect at their call sites through to the tests they create.

Report the repetition a grouped test belongs to in the "(run N/M)" suffix
of its "Start" line, as ctest already does for a test repeating on its own.

Co-authored-by: Tyler Yankee <tyler.yankee@kitware.com>
Fixes: #21438
2026-09-18 08:29:28 -04:00
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
Joerg Bornemann 7c3ca57b91 MSVC,Clang: Set CMAKE_CXX_COMPILER_PREDEFINES_COMMAND for the MSVC ABI
The variable was only set by the GNU-like compiler modules, so AUTOMOC
never generated a moc_predefs.h for compilers targeting the MSVC ABI
and moc parsed headers without the compiler's predefined macros.

MSVC dumps its predefined macros with '/PD', which needs the conforming
preprocessor. Require VS 2019 16.8, because 16.7 and older ignore the
flag with warning D9002 and emit no macros at all. clang-cl takes '-dM'
through '-Xclang'. Both also echo the preprocessed source, so feed them
an empty translation unit. clang with the GNU driver is excluded from
'Compiler/GNU' as well when it simulates MSVC, so give it the usual
'-dM -E' command there.

Fixes: #28093
2026-09-18 11:35:02 +02: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