cmNinjaTargetGenerator: do not order-depend on C++ module sources

C++ module sources should not be included by any other TUs, so their
presence cannot matter for order-only dependencies of the entire target.
Exclude them.

Update CMP0154 to take this into consideration and add tests to the
`CXXModules` suite (which already deals with module support detection).
This commit is contained in:
Ben Boeckel
2023-10-19 22:39:30 -04:00
parent 0973cd6702
commit ed45432571
8 changed files with 88 additions and 6 deletions
+6
View File
@@ -22,6 +22,12 @@ type ``HEADERS``. With this information, :ref:`Ninja Generators` may omit
the above-mentioned conservative dependencies and produce more efficient
build graphs.
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
compiling other sources in the same target. Since these files should not be
included at compile time directly, they may not be implicitly required to
exist for other compilation rules.
This policy provides compatibility for projects using file sets in targets
with generated header files that have not been updated. Such projects
should be updated to express generated public headers in a file set.