Commit Graph
15998 Commits
Author SHA1 Message Date
Brad King f4c33c7762 Merge topic 'better-policy-diagnostics'
763cfbcac8 Diagnostics: "Fix" policy warnings in modules
a7415d243a Diagnostics: Simplify issuing policy warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12079
2026-05-21 09:47:07 -04:00
Matthew Woehlke 763cfbcac8 Diagnostics: "Fix" policy warnings in modules
Introduce a mechanism (via the private and undocumented `ISSUE_WARNING`
option to the `cmake_policy` command) to allow built-in modules to issue
policy warnings. Update modules to use this.

This allows modules to issue policy warnings with the `CMD_POLICY`
diagnostic type, which is consistent with internally issued diagnostics.
This also tends to simplify the logic for issuing such warnings in much
the way the helpers introduced in the previous commit did for the C++
code.
2026-05-20 15:32:57 -04:00
Brad King 0e3c395205 PellesC: Fix architecture detection when enabling both C and ASM_POASM
We detect the architecture once and store it in `_PellesC_ARCH`.
Do not unset it after the first language is enabled.

This fixes commit bc51518821 (PellesC: Compile for architecture matching
LIB environment variable, 2026-05-07) by removing lines left from an
earlier draft of the change.

Issue: #21536
Reported-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-05-19 10:12:36 -04:00
Brad King 485b155cb9 Merge topic 'swift-pdb'
404f6bac3c Swift: support PDB emission with Swift

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12064
2026-05-19 09:04:41 -04:00
Brad King ea31fd8986 Merge topic 'write-basic-package-version-file-compatibility'
9bd3346655 CMakePackageConfigHelpers: add more version compatibility modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11994
2026-05-16 09:44:24 -04:00
Brad King 6f3c85f7a9 Merge topic 'flang-windows'
95abfcbe51 LLVMFlang: Add support for MSVC_RUNTIME_CHECKS abstraction on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12072
2026-05-16 09:36:32 -04:00
Saleem Abdulrasool 404f6bac3c Swift: support PDB emission with Swift
Swift supports CodeView/PDB for Windows (with active development ongoing
to make it the default). It is currently usable but does not have the
same fidelity as DWARF, but can be sufficient for many use cases. The
user is able to control this via flags. Wire up the necessary support to
allow `TARGET_PDB_FILE` to be used with Swift/Swift-only targets.
2026-05-16 09:05:46 -04:00
Brad King 95abfcbe51 LLVMFlang: Add support for MSVC_RUNTIME_CHECKS abstraction on Windows
Extend commit 2b2344b412 (MSVC: Add abstraction for runtime checks,
2025-01-22, v4.0.0-rc1~92^2) to cover LLVMFlang.  This is necessary
to configure with CMP0184's NEW behavior.
2026-05-15 17:30:47 -04:00
Brad King f53ee8be4b LLVMFlang: Fix flags for shared libraries on AIX
On most platforms we create shared libraries with `-shared` by default,
but on AIX we add `-Wl,-bnoipath` before the default is applied.
Explicitly specify `-shared` for LLVMFlang instead.

Also add compilation flags for position-independent code.

Fixes: #27818
2026-05-15 15:06:58 -04:00
Daniele E. Domenichelli 9bd3346655 CMakePackageConfigHelpers: add more version compatibility modes
Add `SamePatchVersion`, `SameFullVersion`, and `SemanticVersion`
support.

Document `ExactVersion` as deprecated in favor of the clearer
`SamePatchVersion`/`SameFullVersion` names.

Closes: #18060
2026-05-15 13:51:11 -04:00
Brad King e0b79bddd0 Merge topic 'ctest-llvm-cov'
e0ac166e7b ctest: Parse Clang Source code coverage files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12049
2026-05-15 10:16:00 -04:00
Brad King f369fc8f56 Merge topic 'pellesc-windows-libs'
b91c1fc3a9 PellesC: Pass common Windows SDK libraries to linker by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12061
2026-05-15 10:11:28 -04:00
Brad King 686f278097 Merge topic 'pellesc-c-std'
713f4b76ee PellesC: Add C standard levels for Pelles C versions 9 through 12
1f5c9a31f4 PellesC: Remove UTF-8 BOM from test .asm files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12059
2026-05-15 10:09:53 -04:00
Brad King 5b68160cab Merge topic 'emscripten-shared-libs'
0182611a56 Emscripten: Restore linking shared libraries with `-shared` flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12058
2026-05-15 10:03:38 -04:00
Brad KingandSerguei E. Leontiev b91c1fc3a9 PellesC: Pass common Windows SDK libraries to linker by default
We already do this for MSVC and MinGW.  The linker ignores them
if no symbols are needed.

Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-05-14 11:34:36 -04:00
Brad KingandSerguei E. Leontiev 713f4b76ee PellesC: Add C standard levels for Pelles C versions 9 through 12
Full C23 support was not added until version 12.

Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-05-14 10:37:46 -04:00
Brad King 0182611a56 Emscripten: Restore linking shared libraries with -shared flag
Prior to CMake 4.2.0, projects using the EMSDK's toolchain file while
also enabling `TARGET_SUPPORTS_SHARED_LIBS` would link shared libraries
using our default `-shared` flag plus whatever `-sSIDE_MODULE` flag
the project added, if any.  CMake 4.2.0 introduced builtin Emscripten
support, but since commit d361bf365e (Emscripten: Drop hard-coded
-sMAIN_MODULE and -sSIDE_MODULE flags, 2025-09-18, v4.2.0-rc1~146^2)
we still leave it to projects to add Emscripten-specific flags needed
to link shared libraries.

Restore the pre-4.2 behavior of adding the `-shared` flag.  In
particular, this is needed for upcoming Emscripten support for real
shared libraries.

Issue: #27240
2026-05-14 09:24:49 -04:00
Kyle Edwards cdacf44fe8 Merge topic 'findcudatoolkit-nvml-static-dl'
af0828cbbf FindCUDAToolkit: Link CUDA::nvml_static against DL libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !12055
2026-05-14 09:02:48 -04:00
Brad King e5add278b9 Merge topic 'clang-eco-std'
82b1e97362 c++modules: Relax clang EcoStd prereqs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12053
2026-05-14 08:57:04 -04:00
Joseph Snyder e0ac166e7b ctest: Parse Clang Source code coverage files
Introduce the capability to use the Clang Source code coverage capability
to generate coverage information for a submission to CDash.

This handler will:
  * Recursively glob the binary directory for coverage files (`*.profdata`)
  * Use the `llvm-profdata` tool to merge all found files into a single
    `default.profdata` file
  * Recursively glob the binary directory for .o files
  * Use the `llvm-cov export` capability to parse the coverage information
    found for each object file

Since the coverage information contains branch coverage, add new attributes
to the CoverageLog Line object to capture the number of branches that are
covered and uncovered

See documentation page here
https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
2026-05-14 08:35:49 -04:00
Kyle Edwards af0828cbbf FindCUDAToolkit: Link CUDA::nvml_static against DL libraries
And fix a potential failure mode where CUDA::sanitizer was already
added in a different project.
2026-05-13 16:30:30 -04:00
yacoub hossain 389de4912f InstallRequiredSystemLibraries: use ARM64 redist path for ARM64EC 2026-05-13 13:10:07 -04:00
Marcel Laverdet 82b1e97362 c++modules: Relax clang EcoStd prereqs
The path-detection routine which sets a default value for
'CMAKE_CXX_STDLIB_MODULES_JSON' is too strict. If the variable is
already set then no additional detection is needed by cmake.

This is relevant when compiling with clang and linking against
Microsoft's STL.
2026-05-13 18:52:19 +02:00
Brad King 54590f1ae6 Merge topic 'iccarm-next'
6fe9de264b IAR: changes for the upcoming compiler version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12030
2026-05-12 10:46:03 -04:00
Brad King 64fc2f8089 Merge topic 'ctest-llvm-cov'
a79ac015c6 ctest: Merge llvm-cov's .profraw files into a .profdata file for each test
5494697ed1 Tests: Add case for llvm-cov usage by ctest command line modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12007
2026-05-12 10:32:10 -04:00
Brad King da83ac8b9b Merge topic 'FindBoost-1.91'
8a4f5b0afb FindBoost: Add support for Boost 1.91

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Christoph Grüninger <foss@grueninger.de>
Merge-request: !12045
2026-05-12 09:48:22 -04:00
Brad King 8a4f5b0afb FindBoost: Add support for Boost 1.91
Update the list of known versions.

Run the command

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

to extract dependencies from the 1.91.0 source tree.

Dependencies differ from 1.90:

* Boost.Iostreams no longer depends on Boost.Regex
* Boost.Log no longer depends on Boost.Regex

Fixes: #27803
2026-05-11 16:55:05 -04:00
Serguei E. Leontiev 884d312784 PellesC: Add makefile rules for preprocessor and assembly output
Issue: #21536
2026-05-11 14:55:38 -04:00
Brad KingandSerguei E. Leontiev bc51518821 PellesC: Compile for architecture matching LIB environment variable
Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-05-11 14:55:12 -04:00
Brad King 20ccf97df8 PellesC: Configure linker mode for ASM_POASM
This was missed in commit a95fae2d36 (PellesC: Add support for ASM_POASM
language assembler, 2026-04-21).
2026-05-11 14:11:31 -04:00
Joseph Snyder a79ac015c6 ctest: Merge llvm-cov's .profraw files into a .profdata file for each test
If the CTEST_TEST_COVERAGE_TOOL is set to LLVM-COV, use the
`llvm-profdata --merge` functionality to collect the `.profraw` files
generated by running each test into a combined `.profdata` file.
This is the file that could be used to parse or display coverage
information for each test.

Issue: #26932
2026-05-11 11:33:41 -04:00
Brad King df6629b401 Merge topic 'cuda-compiler-detection-error'
30488911c7 CUDA: Better diagnostic error when compiler identification fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12029
2026-05-11 11:17:17 -04:00
Felipe Torrezan 6fe9de264b IAR: changes for the upcoming compiler version
Significant changes on the next major version of the IAR compiler
required some changes in CMake:

- __IAR_COMPILERBASE__ offers a fine grained versioning option
  in comparisom with __IAR_SYSTEMS_ICC__, which only referred
  to the IAR internal platform version.

- C++20 Language support added for Arm (v10.10.1+), where libc++
  is used by default.
2026-05-11 11:25:57 +02:00
Robert Maynard 30488911c7 CUDA: Better diagnostic error when compiler identification fails
Fixes: #27800
2026-05-08 09:48:31 -04:00
Brad King eb1a6e2169 Merge topic 'exe-check-find'
7406f0be82 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12025
2026-05-08 07:45:27 -04:00
Brad King 64b8f7251d Merge topic 'nasm-32bit'
3e2d51e823 ASM_NASM: Detect 32-bit object formats from C or C++ target architecture

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12026
2026-05-08 07:25:22 -04:00
scivision 7406f0be82 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Capture `execute_process` calls' `RESULT_VARIABLE`.

We don't actually need to check the result as we presume the existing
logic is already adequate, and sometimes programs return non-zero values
as result of valid query.  I.e. this is a "safe" way to broadly protect
these scripts.

Issue: #27782
2026-05-07 13:36:36 -04:00
St Rangeset f9a127c713 ASM_NASM: Allow flags to override default object format
Move the `<FLAGS>` placeholder to after our builtin `-f` format flag.
This ensures user-specified flags take precedence, as NASM uses
the last occurrence of the `-f` argument.

Issue: #27797
2026-05-07 09:54:34 -04:00
Brad King 3e2d51e823 ASM_NASM: Detect 32-bit object formats from C or C++ target architecture
Fixes: #27797
2026-05-07 09:44:58 -04:00
Brad King 57a1945745 Merge topic 'exe-check'
8d48d755f0 Tests: Add missing execute_process result checks
a1b5c0da87 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
6b4432bc10 FindGit: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12011
2026-05-07 08:07:07 -04:00
Brad King 68b4d85d65 Merge topic 'fix_f90_try_compile'
eaa32fad4d Fortran: Fix check for F90 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12018
2026-05-07 08:03:22 -04:00
Brad King ea1d99dc18 Merge topic 'nagfor_response_files'
65fbe16e16 NAG Fortran: Use `-xldarg @` to pass response files to the linker
6dc46638f4 NAG Fortran: Fix response file flag for creating archives
b53d3c7cc1 Makefiles: Make logic enabling CUDA device link response files more specific

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12013
2026-05-07 08:01:36 -04:00
Simon Maertens eaa32fad4d Fortran: Fix check for F90 support
Since commit db76876db5 (Modules: Use new SOURCES_FROM_* try_compile
(1/2), 2022-09-26, v3.25.0-rc1~74^2~1) the variable containing the F90
code was named incorrectly.  Thus the compilation test was performed on
an empty source file.
2026-05-06 15:21:32 -04:00
scivision a1b5c0da87 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Capture the `execute_process` command's `RESULT_VARIABLE`.

Issue: #27782
2026-05-06 11:16:36 -04:00
Brad King bfeef792bb Merge topic 'openwatcom-linker-id'
2e549c1df4 CMakeDetermineLinkerId: support the OpenWatcom linker ID

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12012
2026-05-06 10:21:23 -04:00
scivision 6b4432bc10 FindGit: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Issue: #27782
2026-05-06 03:18:34 -04:00
Simon Maertens 65fbe16e16 NAG Fortran: Use -xldarg @ to pass response files to the linker
The `nagfor` compiler driver does not invoke the linker directly.
Instead it runs the system C compiler driver, which then invokes the
linker.  Passing `@` to NAG Fortran expands the response file before
it reaches the linker, which might lead to too long linker lines.
`-Wl,@`, used since commit 10d6c3a635 (NAG: Pass response files
through front-end to the linker, 2018-08-01, v3.13.0-rc1~244^2), can
lead to wrong placement of the response file on the linker line and
doesn't work at all when the response file is the only object file
passed to the NAG Fortran frontend.

Instead use `-xldarg @` to pass a response file through to the linker
without any intermediate expansion.  However, the response file
generated by Ninja can contain flags meant for the compiler driver,
so we need to disable response files for these flags altogether.

Fixes: #23577
2026-05-06 02:00:40 +01:00
Simon Maertens 6dc46638f4 NAG Fortran: Fix response file flag for creating archives
Since commit 10d6c3a635 (NAG: Pass response files through front-end to
the linker, 2018-08-01, v3.13.0-rc1~244^2) we use `-Wl,@` instead of `@`
in order to pass the response file through the `nagfor` compiler driver
to the linker.  However, this is not needed for the archiver.  Create
a separate rule variable so we can use different response file flags
for archiving and linking.

Issue: #23577
2026-05-05 20:07:17 -04:00
Serguei E. Leontiev 7750b59f17 PellesC: Add support for long link lines using response files
Issue: #21536
2026-05-05 15:35:05 -04:00
Ben Boeckel 2e549c1df4 CMakeDetermineLinkerId: support the OpenWatcom linker ID 2026-05-05 12:24:59 -04:00