In commit 42dfcbf1a5 (GNUInstallDirs: Refactor LIBDIR default
calculation, 2025-03-27, v4.1.0-rc1~384^2~2) we introduced the
`_GNUInstallDirs_LIBDIR_get_default` helper and exercised code from
commit 9789f7d05e (GNUInstallDirs: Add internal helper to compute
specific defaults, 2025-03-28, v4.1.0-rc1~384^2~3) for the first time.
Fix the latter's code to update the `CMAKE_INSTALL_<dir>` cache entry
without triggering conversion of a relative path to an absolute path.
Fixes: #27027
Although there is no `cl -std:c23` flag, the underlying Clang compiler
does have a C23 mode we can activate by passing `-std=c23` through a
`clang-cl` wrapper flag.
Also port the fix from commit 30139913e9 (VS: Restore support for mixing
C++23 and C in one target with clang-cl, 2024-12-09, v3.31.3~10^2).
Fixes: #27038
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: Brad King <brad.king@kitware.com>
Extend commit 5b10f96793 (Linux: Compile with _FILE_OFFSET_BITS=64 on
32-bit Linux, 2020-09-23, v3.19.0-rc1~112^2) to cover `time_t` too,
by compiling with `_TIME_BITS=64`.
POSIX specifies that two leading slashes have implementation-defined
interpretation, so CMake 3.31 and below did not normalize away leading
double slashes. However, most implementations simply treat a leading
`//` as just `/`, so CMake 4.0 now normalizes them away when they do not
correspond to a network path on Windows.
This change exposed that we were not normalizing `CMAKE_TOOLCHAIN_FILE`
before passing its value to `include()` the first time if it was not
passed with the `FILEPATH` or `PATH` cache entry type. Fix that.
Fixes: #27010
MSBuild adds some `link` flags by default, but for CMake they may not
match what's produced by command-line generators. If these flags are
not specified by the project or user, suppress them.
Fixes: #27004
Extend commit 844d79916a (cmake --build: Add support for driving Xcode
workspaces, 2025-06-02) to support multiple `--target` arguments.
`xcodebuild -scheme` cannot be repeated in a single call, so call it
multiple times instead.
Issue: #26958
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
When installing FILE_SETs, it is possible the FILE_SET has not yet been
created with target_sources(FILE_SET). Instead of ignoring this
situation, we need to track the installed FILE_SET names and their
possible install destinations.
At generation time we resolve the names and destinations concretely. If
a FILE_SET wasn't provided or isn't an INTERFACE, we silently bail out.
Fixes: #26697
0e53a67a7b cmFindPackage: fix over-reporting
8b3fc9578a cmFindPackageCommand: report found files to debugging infra
ee062ce4d0 cmFindCommon: test implicit configure log event reporting
a90598f17c cmFindCommon: support suppressing implicit event logging
5aefc8b7b8 cmFindBase: let the debug state know if it has already been found
928a74f684 cmFindCommon: always track configure log information
4fa647a544 Tests: Match RunCMake.try_{compile,run} configure log more precisely
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10783
External tools may create a `.xcworkspace` directory next to the
`.xcodeproj` directory that CMake generates. If a workspace exists,
drive the build through it instead.
Closes: #26958
Co-authored-by: Brad King <brad.king@kitware.com>
92d6126450 MSVC: Move link -machine flag out of CMAKE_*_LINKER_FLAGS
bb8baacbcc MSVC: Factor out link -machine flag name
4c6c7f4d45 MSVC: Move link -subsystem flag handling near and -machine flag handling
f1a80a5581 CUDA: Drop unused link rule variable setting on Windows
a0732ce47f CMAKE_STATIC_LINKER_FLAGS: Fix terminology in cache entry help string
53aab8acd6 Tests: Generalize test name RunCMake.MSVC{Warning => Default}Flags
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10849
Upcoming versions of nvcc are adding support for `SYSTEM_INCLUDES`
which contain includes that are implicitly used with `-isystem`
instead of `-I`.
Support of this is needed in CMake as some CUDA Toolkit releases will
start to have a different include directory layout and using only the
output from `INCLUDES` will be insufficient to find all headers.
Enable the generation of NuGet symbol package(s) with the new variable
`CPACK_NUGET_SYMBOL_PACKAGE`. CPack generates then normal nuget package
(*.nupkg) and a symbol nuget package (*.snupkg). The new generate
package contains PDB files.
Fixes: #26976
The `CMAKE_{EXE,SHARED,MODULE,STATIC}_LINKER_FLAGS` variables are
not language-specific, so multiple languages' toolchains may disagree
about if/how to pass the flag through a compiler driver to the linker.
Furthermore, carrying the flag in public-facing variables allows projects
or users to change it even though it is required. Add policy CMP0197
to remove the flag from the public-facing variables and generate it
automatically instead:
* For command-line generators, add the `-machine:` flag to the
linker and archiver rule variables.
* For Visual Studio generators, we do not need to explicitly add the
link `-machine:` flag. MSBuild automatically adds it, and the new
behavior actually removes a duplicate we generated previously.
Issue: #21934