mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Swift/Ninja: Set copy-if-different on output-file-map.json
Avoid bumping the file's mtime on every configure when its content hasn't changed. Otherwise ninja sees it as modified and re-runs every Swift compile edge that depends on it. Observed in the Swift toolchain build (LLVM monorepo with swift as an external project): a no-op reconfigure cascaded into hundreds of unnecessary edges via per-target output-file-map.json mtime bumps. Issue: #27748
This commit is contained in:
@@ -1438,6 +1438,7 @@ void cmNinjaTargetGenerator::GenerateSwiftOutputFileMap(
|
||||
this->Configs[config].SwiftOutputMap[""] = deps;
|
||||
|
||||
cmGeneratedFileStream output(mapFilePath);
|
||||
output.SetCopyIfDifferent(true);
|
||||
output << this->Configs[config].SwiftOutputMap;
|
||||
|
||||
// Add flag
|
||||
|
||||
Reference in New Issue
Block a user