summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-16 13:34:51 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-16 13:37:35 (GMT)
commit6fd9c68ed02d6b1dc013a6984f890d2c9457b1c8 (patch)
tree2afcf4ca428d836aa62abf80e2f4788977466efc
parent22612dd53a46c7f9b4c3f4b7dbe5c78f9afd9581 (diff)
downloadCMake-6fd9c68ed02d6b1dc013a6984f890d2c9457b1c8.zip
CMake-6fd9c68ed02d6b1dc013a6984f890d2c9457b1c8.tar.gz
CMake-6fd9c68ed02d6b1dc013a6984f890d2c9457b1c8.tar.bz2
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
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 02ffaf7..e10c76e 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -588,8 +588,9 @@ void cmGlobalNinjaGenerator::CleanMetaData()
// `build.ninja` to load for this in Ninja-Multi. This may be relaxed in the
// future pending further investigation into how Ninja works upstream
// (ninja#1721).
- if (this->NinjaSupportsUnconditionalRecompactTool && expectBuildManifest &&
- !missingBuildManifest) {
+ if (this->NinjaSupportsUnconditionalRecompactTool &&
+ !this->GetCMakeInstance()->GetRegenerateDuringBuild() &&
+ expectBuildManifest && !missingBuildManifest) {
run_ninja_tool({ "recompact" });
}
if (this->NinjaSupportsRestatTool && this->OutputPathPrefix.empty()) {