Unity: Clarify source comments on unity build transformation

This commit is contained in:
Brad King
2024-02-02 07:59:21 -05:00
parent 87bf1c6c33
commit 30829da506
2 changed files with 3 additions and 1 deletions

View File

@@ -1892,7 +1892,8 @@ bool cmGlobalGenerator::AddAutomaticSources()
}
}
}
// The above transformations may have changed the classification of sources.
// The above transformations may have changed the classification of sources,
// e.g., sources that go into unity builds become SourceKindUnityBatched.
// Clear the source list and classification cache (KindedSources) of all
// targets so that it will be recomputed correctly by the generators later
// now that the above transformations are done for all targets.

View File

@@ -3131,6 +3131,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
for (size_t ci = 0; ci < configs.size(); ++ci) {
// FIXME: Refactor collection of sources to not evaluate object libraries.
// Their final set of object files might be transformed by unity builds.
std::vector<cmSourceFile*> sources;
target->GetSourceFiles(sources, configs[ci]);
for (cmSourceFile* sf : sources) {