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
This commit is contained in:
Brad King
2026-02-17 17:14:45 -05:00
parent a846b2e4c1
commit a8cf09d49a
+1
View File
@@ -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";