A generator expression such as `$<TARGET_RUNTIME_DLLS:tgt>` reachable
from the link closure of `tgt` causes a nested re-entry into
`GetLinkInformation`. This computation runs over a partially computed
link implementation and leads to bogus generation errors or a crash.
Reserve the cache entry before computing, and error out when the
computation is re-entered.
OpenMP::OpenMP_<lang> carries no device flags, and for GCC and Clang
links the OpenMP runtime without the OpenMP flag, so target regions
built through it fail to link or silently run on the host. Once
OpenMP_<lang>_OFFLOAD or OpenMP_<lang>_OFFLOAD_FLAGS is set, the new
targets add the device flags, plus the OpenMP flag at link time;
otherwise they match the host targets. FindOpenMP.Offload runs a
target kernel on a GPU and is enabled in the nvhpc job.
Fixes: #21784, #26701
On AIX, when AIX_SHARED_LIBRARY_ARCHIVE is off, VERSION and SOVERSION
were ignored and only a single `lib<name>.so` was produced.
Add the AIX_SHARED_LIBRARY_SYMLINKS target property, initialized by the
CMAKE_AIX_SHARED_LIBRARY_SYMLINKS variable, to name the shared object
`lib<name>.so.<version>` and create `lib<name>.so.<soversion>` and
`lib<name>.so` symlinks, as on other UNIX platforms. When the property
is not set, policy CMP0227 selects the default.
AIX shared objects have no builtin soname, so a dependent records the
name of the file used to link it. Link dependents through the
`lib<name>.so.<soversion>` symlink so they need not be rebuilt for a
compatible update. If only VERSION is set, link to
`lib<name>.so.<version>`.
Extend the SharedLibraryArchive test to check the file names, symlinks,
and the library name recorded by dependents.
`cmake.exe`, `ctest.exe` and `cpack.exe` import several Windows system
libraries directly, so the loader maps them, and the libraries they
depend on, every time one of the tools starts. Many runs use none of
them, including most `cmake -E` commands, which run many times in
every build.
When building with MSVC or clang-cl, link the three tools with
`-DELAYLOAD` for these libraries so each one is loaded on first use.
Issue: #28164
Since commit b86a77e8c8 (cm::filesystem::path: ensure independence from
the program locale., 2026-01-05, v4.3.0-rc1~185^2) detection always
fails due on Windows to using `fs` instead of `std::filesystem`.
Also remove the `weakly_canonical` check I added in commit ad4481fa00
(Source: Enhance check for C++17 filesystem support, 2023-12-02,
v3.29.0-rc1~296^2). It was a bad idea since it accesses the filesystem,
and so in general this can give false negative say in the case of
`CMAKE_BINARY_DIR` being on a symlinked drive.
Fixes: #28221
9608d421c7 Utilities: Update hard-coded try_compile results for libarchive 3.8.10
a855f0d0c4 libarchive: Set build options the way we need for CMake
1acae99df2 libarchive: Add cm3p prefixes on includes new to 3.8.10
0baf44d025 Merge branch 'upstream-LibArchive' into update-libarchive
fd7af8dc6d LibArchive 2026-10-14 (0c48412b)
5956f9d466 libarchive: Update script to get 3.8.10
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12732
Some have gone historically "undocumented" in that they are listed in
`ctest(1)` and are intended for public use, but aren't listed in
`cmake-variables(7)` with their own variable pages.
The forms showing configure/generate output, help, and the log were
allocated with new and never deleted. Make them local objects, and
point CurrentForm back to the main form as soon as they are closed so
the resize handler never sees a destroyed form.
When Configure() or Generate() failed with -2 (e.g. no CMakeLists.txt
in the source directory) they returned while CurrentForm still pointed
at the message form. main() then deleted that form instead of the main
form, leaking the main form together with its cmake instance.
InitializeUI() replaced the cache entry widgets and the "EMPTY CACHE"
placeholder, and RemoveEntry() erased an entry, while the form still
referenced their fields. free_field() fails on connected fields, so
every reconfigure and every deleted entry leaked fields. Free the form
first; RePost() and Render() create a new one afterwards.
free_field() refuses to free a field that is still connected to a form
and returns E_CONNECTED. ~cmCursesLongMessageForm freed its field
before the base class destructor freed the form, so the field and its
buffer leaked every time a long message form was destroyed.
The minimum compiler versions were determined in the GCC and LLVM
repositories as follows. The first release containing a commit is the
lowest release tag listed by ``git tag --contains <commit>``. Since a
point release of an older series can be listed although it lacks the
commit, ``git grep`` at the tag confirms the change.
1. The header requires __has_cpp_attribute to accept scoped names such
as gnu::visibility. The commit adding this is the oldest one whose
diff touches a line parsing the "::" token:
gcc$ git log --reverse --format=%H -G'CPP_SCOPE' \
-- gcc/c-family/c-lex.c
llvm-project$ git log --reverse --format=%H \
-G'Ident__has_cpp_attribute.*coloncolon' -- clang/lib/Lex
This yields 42fd12b1e7fc50183bcf62861aae81301a9efbcf in
releases/gcc-5.1.0 and a0344c5d7b9b748a2244dce393ceb55e83b495d6 in
llvmorg-3.6.0.
2. The GCC commit accepting mixed attribute spellings references its bug
https://gcc.gnu.org/PR69585 in the message:
gcc$ git log --format=%H --grep=c++/69585
This yields aec868578d8515763d75693c1fdfbc30ff0a1e68 in
releases/gcc-13.1.0.
Fixes: #22908
Issue: #20527
`cmake --version` and the other documentation options build the
generator documentation even when they do not print it. That evaluates
the default generator, which on Windows queries the Visual Studio Setup
COM API for VS 18, 17, 16 and 15 in turn and constructs the newest
Visual Studio generator found. It makes `cmake --version` take about
100 ms on Windows, which is a lot for a command that tools run often
to detect CMake.
Only `--help` and the generator listing print generators. Evaluate them
only for those requests.
Fixes: #28220
Add a new compiler id, EMBTClang, for the Embarcadero clang-based Win64
compiler (bcc64x), as a Clang variant detected by its __CODEGEARC__ marker
on the MinGW-w64 target, and exclude that target from the Embarcadero
compiler id.
Provide Compiler/ and Platform/ modules for C, CXX, and ASM, including
feature tests, binutils discovery with the linker, resource compiler, and
LLVM binutils pinned to the toolchain, and the derived RTL and include
directories forwarded into try_compile.
Drive the WIN32_EXECUTABLE property through the toolchain's console and GUI
subsystem switches, and add an EMBT_RUNTIME_LIBRARY target property
(Static or Dynamic) implemented like WATCOM_RUNTIME_LIBRARY and
MSVC_RUNTIME_LIBRARY.
Build shared and module libraries as plain DLLs. Search for libraries as
name.lib before the MinGW names, and do not add the GNU -Bstatic and
-Bdynamic switches. Do not provide a C++ module dependency scanning rule:
the toolchain's clang-scan-deps does not apply the bcc64x driver's target,
standard, and include paths.
Document the new id and property, and add RunCMake and build tests covering
detection, the runtime-library property, binutils pinning, the console/GUI
subsystem macros, precompiled header reuse across target kinds, and C++20
builds without module scanning.
Closes: #26769
The Borland compiler identification test matches any compiler that
defines __BORLANDC__, including the Clang-based Embarcadero compilers.
Those are identified as Embarcadero before Borland is tried, so the
result does not change, but exclude them so that the test matches only
the compilers it is meant to identify.
The 32-bit Borland and Embarcadero compilers prefix C symbol names with
an underscore. The 64-bit Embarcadero compilers also define __BORLANDC__
but do not add the prefix.
With ORDER=FORWARD link processing, the override-features2 check expects
the non-target library other1 with the import library prefix and suffix,
which for MinGW is libother1.dll.a. It is linked by its name, as the
check already expects without ORDER=FORWARD. Match it the same way.
ORDER=FORWARD is set for MSVC, whose expected pattern does not change,
and for lld with the GNU command-line frontend, as in llvm-mingw.
The test sources check WIN32, which not every Windows toolchain defines:
bcc64x defaults to a strict standard mode and does not. Check _WIN32.
The test scripts use GetPrerequisites, which looks for objdump on the
PATH when dumpbin is not found and CMAKE_OBJDUMP is not set. The objdump
in llvm-mingw is a shell script, and bcc64x provides only llvm-objdump.
Pass the project's CMAKE_OBJDUMP to the scripts.
1ec0ddf399 VS: Only generate RC options if necessary
29d594d95a VS: Only generate MIDL options if necessary
b07b27d57c VS: Only generate MASM options if necessary
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12708