diff options
author | Brad King <brad.king@kitware.com> | 2020-01-27 20:31:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-27 20:39:04 (GMT) |
commit | ccaa0bccc42a31f7515c6f85a0601ac0ad006e96 (patch) | |
tree | 308ecc3051bab349341ffcaa4ee4df606bcba7b9 /Source | |
parent | 657820a00b83cb28e018a94af2a8bf7475827c8b (diff) | |
download | CMake-ccaa0bccc42a31f7515c6f85a0601ac0ad006e96.zip CMake-ccaa0bccc42a31f7515c6f85a0601ac0ad006e96.tar.gz CMake-ccaa0bccc42a31f7515c6f85a0601ac0ad006e96.tar.bz2 |
Ninja: Do not clean metadata when re-generating inside a running build
When `ninja` re-runs CMake to re-generate the build system, do not try
to use the ninja tools to update metadata on Windows. The outer ninja
process is already holding the files open.
Issue: #20274
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index f92ffd3..d093c43 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -528,7 +528,15 @@ void cmGlobalNinjaGenerator::Generate() this->CloseRulesFileStream(); this->CloseBuildFileStreams(); - this->CleanMetaData(); +#ifdef _WIN32 + // The ninja tools will not be able to update metadata on Windows + // when we are re-generating inside an existing 'ninja' invocation + // because the outer tool has the files open for write. + if (!this->GetCMakeInstance()->GetRegenerateDuringBuild()) +#endif + { + this->CleanMetaData(); + } } void cmGlobalNinjaGenerator::CleanMetaData() |