1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 22:37:30 +08:00

Ninja: Do not recompact deps log in regeneration during a build

Since commit fb18215904 (Ninja: clean ninja metadata once generated,
2019-05-13, v3.17.0-rc1~207^2) we recompact the ninja deps log during
regeneration.  That does not make sense during a build, so skip it if we
are regenerating during a build.

This problem went unnoticed previously because on non-Windows platforms
the deps log is just overwritten again by the outer build.  On Windows
platforms, recompaction during the build fails, but we did not actually
try to do that until commit 11f4259362 (Ninja: Clean metadata after
regen during build on Windows with 1.10.2+, 2020-11-30, v3.19.2~29^2~1).

Fixes: #21916
This commit is contained in:
Brad King
2021-03-16 09:34:51 -04:00
parent 22612dd53a
commit 6fd9c68ed0

View File

@@ -588,8 +588,9 @@ void cmGlobalNinjaGenerator::CleanMetaData()
// `build.ninja` to load for this in Ninja-Multi. This may be relaxed in the // `build.ninja` to load for this in Ninja-Multi. This may be relaxed in the
// future pending further investigation into how Ninja works upstream // future pending further investigation into how Ninja works upstream
// (ninja#1721). // (ninja#1721).
if (this->NinjaSupportsUnconditionalRecompactTool && expectBuildManifest && if (this->NinjaSupportsUnconditionalRecompactTool &&
!missingBuildManifest) { !this->GetCMakeInstance()->GetRegenerateDuringBuild() &&
expectBuildManifest && !missingBuildManifest) {
run_ninja_tool({ "recompact" }); run_ninja_tool({ "recompact" });
} }
if (this->NinjaSupportsRestatTool && this->OutputPathPrefix.empty()) { if (this->NinjaSupportsRestatTool && this->OutputPathPrefix.empty()) {