summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx8
-rw-r--r--Source/cmGlobalNinjaGenerator.h5
2 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 7ef69f4..4147ba8 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -540,10 +540,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();
@@ -692,6 +693,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(
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 40d3cfc..8df0372 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -377,6 +377,10 @@ public:
{
return "1.10";
}
+ static std::string RequiredNinjaVersionForMetadataOnRegeneration()
+ {
+ return "1.10.2";
+ }
bool SupportsConsolePool() const;
bool SupportsImplicitOuts() const;
bool SupportsManifestRestat() const;
@@ -542,6 +546,7 @@ private:
bool NinjaSupportsUnconditionalRecompactTool = false;
bool NinjaSupportsCleanDeadTool = false;
bool NinjaSupportsMultipleOutputs = false;
+ bool NinjaSupportsMetadataOnRegeneration = false;
private:
void InitOutputPathPrefix();