cmGlobalNinjaGenerator: Clarify order of codegen build statement logic

Make it more consistent with the equivalent logic for "all".
This commit is contained in:
Brad King
2024-12-10 10:27:06 -05:00
parent 5f33736c03
commit 505ffdcbde

View File

@@ -1641,11 +1641,13 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
this->ConvertToNinjaPath(cmStrCat(currentBinaryDir, "/codegen"));
for (auto const& config : configs) {
build.ExplicitDeps.clear();
build.Outputs.front() =
this->BuildAlias(buildDirCodegenTarget, config);
for (DirectoryTarget::Target const& t : dt.Targets) {
if (this->IsExcludedFromAllInConfig(t, config)) {
continue;
}
std::vector<cmSourceFile const*> customCommandSources;
t.GT->GetCustomCommands(customCommandSources, config);
for (cmSourceFile const* sf : customCommandSources) {
@@ -1660,8 +1662,6 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
}
}
build.Outputs.front() =
this->BuildAlias(buildDirCodegenTarget, config);
// Write target
this->WriteBuild(this->EnableCrossConfigBuild() &&
this->CrossConfigs.count(config)