1599 Commits
Author SHA1 Message Date
Brad King 98ff37f09f Merge topic 'LLVMFlang-Apple-Flang-18-19' into release-4.5
45208d7353 LLVMFlang: Support Flang 18 and 19 on Apple platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12642
2026-10-15 10:30:12 -04:00
Daksh Mamodiya 45208d7353 LLVMFlang: Support Flang 18 and 19 on Apple platforms
Flang gained -Xlinker only in LLVM 20, so the Apple linker flags added
by commit 18d65b9d4b (LLVMFlang: Fix Fortran shared library creation on
Apple platforms, 2026-09-23) fail with older Flang.  For those versions
the flags now go through -Wl, with the install name joined to its flag.
Flang 20 and later keep the -Xlinker form.

Fixes: #28148
2026-10-14 09:35:43 -04:00
Vito Gamberini 21213ae1d9 DPClang: add compiler support
Fixes: #28157
2026-10-13 14:59:23 -04:00
Brad King 9eab45da5f Merge topic 'sycl-language'
29fa0adc3e ci: enable SYCL tests on Fedora
f69754ad63 SYCL: Initial language implementation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12467
2026-10-09 08:49:00 -04:00
Vito Gamberini f69754ad63 SYCL: Initial language implementation
Add experimental support for SYCL under an experimental gate. The
IntelLLVM and Adaptivecpp compilers are recognized, as well as upstream
Clang with libsycl support.

Fixes: #27219, #27905
2026-10-07 11:43:31 -04:00
Joerg Bornemann 6b14597177 OHOS: Add linker configuration files
Since commit 1e35163ae8, the WHOLE_ARCHIVE feature is defined in the
linker configuration modules. OHOS had no such files, so
$<LINK_LIBRARY:WHOLE_ARCHIVE,...> failed there.

Add forwarding files to the Linux linker configuration, as done for
Android in commit d2997ab601. Unlike Android, fall back to LLD when the
linker cannot be identified, because the OHOS SDK toolchain file links
with -fuse-ld=lld.
2026-10-07 13:58:13 +02:00
Vito Gamberini 3fae9133cc CUDA: Support clang-cl
Fixes: #28139
2026-10-04 22:11:50 -04:00
Daksh Mamodiya 6401308473 CUDA: Add per-language module -DEF: flag on Windows
NVIDIA CUDA links with `link.exe` directly, but had no
`CMAKE_CUDA_LINK_DEF_FILE_FLAG` and fell back to the global
`CMAKE_LINK_DEF_FILE_FLAG`.  With IntelLLVM enabled in the same build
tree, that holds `/Qoption,link,/DEF:`, which `link.exe` ignores, so a
CUDA DLL exported nothing from its `.def` file.  Commit 8b710d8264
(Linker: Generate per-language module -DEF: flags on Windows,
2025-05-28) covered the other Windows toolchains but missed CUDA.

Fixes: #25598
Issue: #26005
2026-10-01 23:26:45 +05:30
Daksh Mamodiya 89e5c19c55 Linker: Generate per-language link directory flags on Windows
IntelLLVM links through the compiler driver, so its link directory
flag is wrapped in `/Qoption,link,`.  MSVC and CUDA run `link.exe`
directly.  When both are used in one build tree, the IntelLLVM value
of `CMAKE_LIBRARY_PATH_FLAG` leaked onto `link.exe` command lines.
Setting `CMAKE_<LANG>_LIBRARY_PATH_FLAG` per language, as was done
for `CMAKE_<LANG>_LINK_DEF_FILE_FLAG`, gives each link line the
spelling its own linker understands.  The variable is now documented.

Fixes: #28116
2026-10-01 15:37:42 +05:30
Brad King e37c9d16e3 Merge topic 'LLVMFlang-Apple-link-flags'
18d65b9d4b LLVMFlang: Fix Fortran shared library creation on Apple platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12546
2026-09-25 10:01:40 -04:00
Brad King 9ae90c2e03 Merge topic 'gfortran-isysroot'
cc6bcefc6a Apple: Restore detection of platform-specific GNU Fortran flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12548
2026-09-25 09:46:42 -04:00
Matthew Thompson 18d65b9d4b LLVMFlang: Fix Fortran shared library creation on Apple platforms
LLVMFlang requires Apple-specific linker options to be forwarded through
`-Xlinker`.

Fixes: #27558
2026-09-23 13:55:56 -04:00
Brad King cc6bcefc6a Apple: Restore detection of platform-specific GNU Fortran flags
Detection of `-isysroot` was broken by commit a1b5c0da87 (Modules:
Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL, 2026-05-05,
v4.4.0-rc1~209^2~1) because `gfortran -v --help` returns non-zero.

Fixes: #28111
2026-09-23 10:04:30 -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
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
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
Brad King 835dfdfbac OrangeC: Fix compiling Windows Resources with only CXX enabled
Fix commit 402d72b6c0 (OrangeC: Add support for compiling Windows
Resources, 2026-03-24, v4.4.0-rc1~444^2~1) to work for both C and CXX.

Inspired-by: Arha Gatram <agatram@nvidia.com>
2026-08-05 14:21:10 -04:00
Brad King 635b42c3ff Merge topic 'ibm-flang'
ee76398d23 IBMLLVMFlang: Add support for this compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12138
2026-06-04 10:09:27 -04:00
Brad King 6e995093d9 Merge topic 'fix-build-tree-prefix-leak'
fd660330e0 find_*: Avoid searching prefix derived from CMake's own source tree

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12122
2026-06-04 09:51:29 -04:00
Kelvin Li ee76398d23 IBMLLVMFlang: Add support for this compiler
Add support for the `ibm-flang` compiler tool, a variant of LLVMFlang.

Closes: #27863
2026-06-03 18:35:46 -04:00
Daksh Mamodiya fd660330e0 find_*: Avoid searching prefix derived from CMake's own source tree
When `cmake` is running from its own build tree, `CMAKE_ROOT` is in
the source tree and should not be used to derive a search prefix.

Fixes: #27853
2026-06-03 10:11:21 -04:00
Marc Chevrier 1ca1095736 Linker: enhance pushpop-state detection
Fixes: #27822
2026-06-01 16:50:34 +02:00
Brad King db63557d6a Merge topic 'skip-compiler-check-support'
11adb3b7ae Linker/Windows-MSVC: check for a non-empty linker version
32c12e6901 Modules/CMakeLANGCompiler.cmake.in: quote linker version and frontend variant
31946711d3 CMakeDetermineCompilerSupport: support skipping compiler feature checks
71d908010f Modules/DetermineCompiler: support skipping compiler checks
e267321f93 Modules/DetermineCompiler: avoid the cache for ABI compilations
94f4c64461 Tests/RunCMake/ToolchainSkipsChecks: add tests for skipping compiler checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11917
2026-05-26 16:12:35 -04:00
Ben Boeckel 11adb3b7ae Linker/Windows-MSVC: check for a non-empty linker version 2026-05-21 20:48:45 -04:00
Marc Chevrier 7e42230e01 LLD linker: enhance portability
To ensure that the correct linker is selected (host or device link),
use the generic driver (i.e. lld) rather than a specific linker (like lld-link).

Fixes: #27826
2026-05-21 15:25:49 +02: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
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 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 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 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
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 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
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
Serguei E. Leontiev 7750b59f17 PellesC: Add support for long link lines using response files
Issue: #21536
2026-05-05 15:35:05 -04:00
Brad KingandSerguei E. Leontiev 12e6c14e69 PellesC: Add default -Ze flag to support compilation against Windows APIs
The Pelles C compiler requires MS extensions to support `__declspec`
and other constructs needed to use Windows APIs.  Unfortunately the
flag also disables standard definitions, so restore them.

Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-05-04 10:47:08 -04:00
Serguei E. Leontiev 9db2cf5429 PellesC: Add default compilation and link flags
Specify debug symbols and optimization flags for each configuration.

Issue: #21536
2026-05-01 11:28:49 -04:00
Brad King 811bf8fb89 Merge topic 'LINKER_TYPE-wild'
e96c5ba13d Add the support of the wild linker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11966
2026-04-24 09:16:32 -04:00
Marc Chevrier e96c5ba13d Add the support of the wild linker
Fixes: #27755
2026-04-23 16:21:30 +02:00
Brad KingandSerguei E. Leontiev 1be31e5b61 PellesC: Add support for Windows DLL module definition files
Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-04-23 09:33:32 -04:00
Brad KingandSerguei E. Leontiev a95fae2d36 PellesC: Add support for ASM_POASM language assembler
The Pelles C compiler does not support ASM, and the `poasm` assembler
uses a distinct syntax.  Add a dedicated language as we do for similar
cases from other vendors.  Leave documentation commented out for now
because the PellesC toolchain support in general is not yet documented.

Fixes: #27758
Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-04-22 14:42:00 -04:00
Brad King efc3e90d0d PellesC: Move C-specific compile command to C-specific code path 2026-04-22 14:35:09 -04:00
Brad King fec53c68cd PellesC: Add support for Windows Resources
The PellesC toolchain provides a `porc` tool to compile them.

Note that `polib` fails to archive resource files (`.res`):

    POLIB: fatal error: An internal error occurred

Turn off the static library part of the VSResource test.

Issue: #21536
Inspired-by: Serguei E. Leontiev <leo@sai.msu.ru>
2026-04-20 11:58:39 -04:00
Brad King 9fc0edced9 Merge topic 'treat-arm64-as-matching-arm64e-for-sysroots'
d68bed8397 Apple: Treat arm64 as matching arm64e when resolving arch sysroots

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11903
2026-04-13 10:53:03 -04:00
Brad King 41534f1571 Merge topic 'haiku-rescan'
9a342eb39b Haiku: Add support for RESCAN

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11919
2026-04-13 10:50:00 -04:00
Brad King 3bed3edd45 Merge topic 'Modules-use-NO_CACHE'
80abf737cc Modules: use `find_*(NO_CACHE)`
2c75267803 Modules/CMakeTest*Compiler: use `try_compile(NO_CACHE)`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11914
2026-04-13 10:48:10 -04:00