From a8cf09d49aa8dfed35402e1358a3ea7aa1687045 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 Feb 2026 17:05:42 -0500 Subject: [PATCH] PCH: Fix regression in REUSE_FROM that copies the `.pdb` too often Since commit 99bdf2ae16 (cmLocalGenerator: add PDB copying dependency on its script, 2025-06-16, v4.2.0-rc1~481^2~8) the copy is repeated whenever the copying script is updated. Avoid updating the copy script timestamp when it does not change. Fixes: #27608 --- Source/cmLocalGenerator.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 83dc6b1dca..473de56078 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2914,6 +2914,7 @@ void cmLocalGenerator::CopyPchCompilePdb( std::string const copy_script = cmStrCat(target->GetSupportDirectory(), "/copy_idb_pdb_", config, ".cmake"); cmGeneratedFileStream file(copy_script); + file.SetCopyIfDifferent(true); file << "# CMake generated file\n";