summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-30 19:54:45 (GMT)
committerBrad King <brad.king@kitware.com>2020-11-30 19:57:48 (GMT)
commit11f42593626e1909ac9d56d189c6b3540bfff866 (patch)
tree5ca55a5957630cd32ad1ff8551dda1f835e376c2 /Source/cmGlobalNinjaGenerator.cxx
parent5ef23640535dfd6543bd81c86282e38122169af6 (diff)
downloadCMake-11f42593626e1909ac9d56d189c6b3540bfff866.zip
CMake-11f42593626e1909ac9d56d189c6b3540bfff866.tar.gz
CMake-11f42593626e1909ac9d56d189c6b3540bfff866.tar.bz2
Ninja: Clean metadata after regen during build on Windows with 1.10.2+
Ninja 1.10.2 fixes support for `generator = 1` rules that run metadata update commands during regeneration while a build is running. Update the condition added by commit ccaa0bccc4 (Ninja: Do not clean metadata when re-generating inside a running build, 2020-01-27, v3.17.0-rc1~73^2) to remove our workaround when Ninja is new enough. Fixes: #20274
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index cf45da9..d477c7d 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -539,10 +539,11 @@ void cmGlobalNinjaGenerator::Generate()
this->CloseBuildFileStreams();
#ifdef _WIN32
- // The ninja tools will not be able to update metadata on Windows
+ // Older 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())
+ if (this->NinjaSupportsMetadataOnRegeneration ||
+ !this->GetCMakeInstance()->GetRegenerateDuringBuild())
#endif
{
this->CleanMetaData();
@@ -691,6 +692,9 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
this->NinjaSupportsMultipleOutputs = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
RequiredNinjaVersionForMultipleOutputs().c_str());
+ this->NinjaSupportsMetadataOnRegeneration = !cmSystemTools::VersionCompare(
+ cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
+ RequiredNinjaVersionForMetadataOnRegeneration().c_str());
}
bool cmGlobalNinjaGenerator::CheckLanguages(