diff options
author | Brad King <brad.king@kitware.com> | 2020-12-01 14:26:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-01 14:29:11 (GMT) |
commit | b76013b515df0216afd74456dfd0fb48ff9e68fe (patch) | |
tree | bee2ec09a1a89f374a1ef17900d2e4cee53f3fda /Source | |
parent | 9b0c7273e07fb85d0ebe9d0f2a1906b233905f30 (diff) | |
parent | 73d1c78bf435af11cf5245ad47530f4b4b831412 (diff) | |
download | CMake-b76013b515df0216afd74456dfd0fb48ff9e68fe.zip CMake-b76013b515df0216afd74456dfd0fb48ff9e68fe.tar.gz CMake-b76013b515df0216afd74456dfd0fb48ff9e68fe.tar.bz2 |
Merge topic 'ninja-regen-metadata' into release-3.19
73d1c78bf4 ci: update to use ninja 1.10.2
11f4259362 Ninja: Clean metadata after regen during build on Windows with 1.10.2+
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5555
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 5 |
2 files changed, 11 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( diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index a0724ac..3d92ec9 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -373,6 +373,10 @@ public: { return "1.10"; } + static std::string RequiredNinjaVersionForMetadataOnRegeneration() + { + return "1.10.2"; + } bool SupportsConsolePool() const; bool SupportsImplicitOuts() const; bool SupportsManifestRestat() const; @@ -538,6 +542,7 @@ private: bool NinjaSupportsUnconditionalRecompactTool = false; bool NinjaSupportsCleanDeadTool = false; bool NinjaSupportsMultipleOutputs = false; + bool NinjaSupportsMetadataOnRegeneration = false; private: void InitOutputPathPrefix(); |