diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-10-20 02:39:30 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-10-20 11:18:33 (GMT) |
commit | ed45432571e23ccba77cdb64aa3eb7e109e73329 (patch) | |
tree | 70bf712bfe2b7faba76127ae84f125f546052b7e /Source | |
parent | 0973cd670231ec6a3e09cf22065e4b7dec4503f5 (diff) | |
download | CMake-ed45432571e23ccba77cdb64aa3eb7e109e73329.zip CMake-ed45432571e23ccba77cdb64aa3eb7e109e73329.tar.gz CMake-ed45432571e23ccba77cdb64aa3eb7e109e73329.tar.bz2 |
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).
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index bb1d6f2..05b6690 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1059,13 +1059,18 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( cmFileSet const* fileset = this->GeneratorTarget->GetFileSetForSource( config, this->Makefile->GetOrCreateGeneratedSource(*it)); - if (fileset && - cmFileSetVisibilityIsForInterface(fileset->GetVisibility())) { + bool isVisible = fileset && + cmFileSetVisibilityIsForInterface(fileset->GetVisibility()); + bool isIncludeable = + !fileset || cmFileSetTypeCanBeIncluded(fileset->GetType()); + if (fileset && isVisible && isIncludeable) { ++it; - } else { + continue; + } + if (!fileset || isIncludeable) { ccouts_private.push_back(*it); - it = ccouts.erase(it); } + it = ccouts.erase(it); } } } |