The generator does a lot of tricks in order to make the "rebuild-bff"
target up-to-date immediately after the generation. We can skip all of
those during "TryCompile" runs, which should reduce configure time.
There's no control over the object base name implemented in the
FASTBuild generator. Rather than expecting some half-supported behavior,
just ignore it completely there.
Similarly, Xcode ends up making its own object paths internally
regardless of what CMake would like.
The property settings set things up once, but nothing ensures that
post-reuse hookup that any property changes propagate. Instead, when
computing PDB information, if PCH reuse is enabled, just always use its
values.
Also drop enforcement at generate time of property value consistency as
it is now ignored when PCH reuse is in effect.
Additionally, if a target is PCH-reused, generate a PDB output directory
for it.
The `PchReuseFromIgnoreOwnProps` test failed previously because the
post-reuse link update of the consuming `PDB` properties are no longer
considered. The `PchReuseFromUseUpdatedProps` failed because the
post-reuse link did not update the copy of the properties added to
consuming reuse target properties.
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Issue: #26123
Rerun CMake when `cmake_install.cmake` or `CTestTestfile.cmake` are out
of date. This enables regeneration if a subdirectory is removed before
invoking `ninja`.
Fixes: #26396
This is needed to inject arguments through flag generation mechanisms so
that they can all be unescaped uniformly. Eventually, these methods
should go away and the escape/unescape dance be avoided completely.
By specifying CODEGEN as an argument to add_custom_command the
custom command will be added to a codegen build target.
The intent is to provide a convenient way for users to get
their generated files without having to build the whole project.
This can be helpful for code analysis tools which can be useful
for IDEs and CI.
Sources that will be scanned for C++ module dependencies need to be
excluded from unity builds. We need to compute compile features in
order to know which sources will be scanned. Unity build and PCH
sources can be added afterward without changing the compile features.
This re-implements commit 76b5383123 (cmGlobalGenerator: add unity
sources after computing target compile features, 2024-01-01,
v3.28.2~17^2~1) using a simpler approach that also preserves support for
PCH with Unity builds.
Issue: #25650
Co-authored-by: Ben Boeckel <ben.boeckel@kitware.com>
We need to know which sources will be scanned for C++ module
dependencies in order to exclude them from unity builds. The
addition of unity sources will not change the set of features.
The original GetLanguageOutputExtension took a sourcefile instead of the
name of the language itself. This implementation provided a convenient
handler for when the SourceFile doesn't know what language it is, but
there are times where we know the language, but don't necessarily have a
source file. Adding an overload that takes the name of the language and
returns the extension of that language, or empty string if no extension
is registered.
We need to be able to construct BMIs that will be usable from the client
modules for the target importing the module, so create BMI-only
compilation rules for `IMPORTED` targets to create these BMIs.
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library. Update includes
to satisfy IWYU for our CI job under Debian 12.