From 03f5ffa2ca40ece0b777bd6adde2f54379a83486 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 30 Sep 2025 22:58:34 -0400 Subject: [PATCH 1/2] Help/OPTIMIZE_DEPENDENCIES: move period outside of parenthetical The preceding sentence needs a terminator. --- Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst b/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst index d17251f57a..4f7481c67d 100644 --- a/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst +++ b/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst @@ -27,7 +27,7 @@ any of the following criteria: Objective-C++, assembly, and CUDA are assumed to produce side effects. However, side effects from one language are assumed not to be relevant to another (for example, a Fortran library is assumed to not have any side - effects that are relevant for a Swift library.) + effects that are relevant for a Swift library). As an example, assume you have a static Fortran library which depends on a static C library, which in turn depends on a static Fortran library. The From fac5e622b7d5d48a6e692224ff8b98f4dae593a7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 30 Sep 2025 22:59:04 -0400 Subject: [PATCH 2/2] Help/OPTIMIZE_DEPENDENCIES: xref with CMP0154 documentation Closes: #27250 --- Help/policy/CMP0154.rst | 3 ++- Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Help/policy/CMP0154.rst b/Help/policy/CMP0154.rst index 89a4f67fb1..ebd65611ff 100644 --- a/Help/policy/CMP0154.rst +++ b/Help/policy/CMP0154.rst @@ -20,7 +20,8 @@ their own target by default. Generated public headers must be specified as members of a ``PUBLIC`` (or ``INTERFACE``) ``FILE_SET``, typically of type ``HEADERS``. With this information, :ref:`Ninja Generators` may omit the above-mentioned conservative dependencies and produce more efficient -build graphs. +build graphs. Dependents to such targets may also prune dependencies to such +targets when using the :prop_tgt:`OPTIMIZE_DEPENDENCIES` target property. Additionally, if the custom command's output is a member of a file set of type ``CXX_MODULES``, it will additionally not be required to exist before diff --git a/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst b/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst index 4f7481c67d..fcacb00688 100644 --- a/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst +++ b/Help/prop_tgt/OPTIMIZE_DEPENDENCIES.rst @@ -21,7 +21,9 @@ any of the following criteria: * The dependency has any ``PRE_BUILD``, ``PRE_LINK``, or ``POST_BUILD`` custom commands associated with it. * The dependency contains any source files that were generated by a custom - command. + command. However, if :policy:`CMP0154` is `NEW` for the dependency and it + uses :ref:`File Sets`, only source files that are not in a ``PUBLIC``, + ``INTERFACE``, or of type ``CXX_MODULES`` are considered. * The dependency contains any languages which produce side effects that are relevant to the library. Currently, all languages except C, C++, Objective-C, Objective-C++, assembly, and CUDA are assumed to produce side effects.