pchreuse: always ask the PCH reuse target for PDB information

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.
This commit is contained in:
Ben Boeckel
2025-06-15 00:07:45 +02:00
parent 6e7da8aa95
commit 1d701491a2
20 changed files with 220 additions and 56 deletions
+3
View File
@@ -9,6 +9,9 @@ compiler while building source files.
This property specifies the base name for the debug symbols file.
If not set, the default is unspecified.
If the :prop_tgt:`PRECOMPILE_HEADERS_REUSE_FROM` target is set, this property
is ignored and the reusage target's value of this property is used instead.
.. versionadded:: 4.1
Contents of ``COMPILE_PDB_NAME`` may use
@@ -13,5 +13,8 @@ This is the configuration-specific version of :prop_tgt:`COMPILE_PDB_NAME`.
Contents of ``COMPILE_PDB_NAME_<CONFIG>`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
If the :prop_tgt:`PRECOMPILE_HEADERS_REUSE_FROM` target is set, this property
is ignored and the reusage target's value of this property is used instead.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_NAME_<CONFIG>`
.. include:: include/COMPILE_PDB_NOTE.rst
@@ -21,5 +21,8 @@ This property is initialized by the value of the
:variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY` variable if it is
set when a target is created.
If the :prop_tgt:`PRECOMPILE_HEADERS_REUSE_FROM` target is set, this property
is ignored and the reusage target's value of this property is used instead.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY`
.. include:: include/COMPILE_PDB_NOTE.rst
@@ -20,5 +20,8 @@ if it is set when a target is created.
Contents of ``COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
If the :prop_tgt:`PRECOMPILE_HEADERS_REUSE_FROM` target is set, this property
is ignored and the reusage target's value of this property is used instead.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`
.. include:: include/COMPILE_PDB_NOTE.rst