mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 22:37:30 +08:00
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
This commit is contained in:
@@ -528,7 +528,15 @@ void cmGlobalNinjaGenerator::Generate()
|
|||||||
this->CloseRulesFileStream();
|
this->CloseRulesFileStream();
|
||||||
this->CloseBuildFileStreams();
|
this->CloseBuildFileStreams();
|
||||||
|
|
||||||
|
#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();
|
this->CleanMetaData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalNinjaGenerator::CleanMetaData()
|
void cmGlobalNinjaGenerator::CleanMetaData()
|
||||||
|
Reference in New Issue
Block a user