mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 14:50:10 -06:00
PCH PDB: Fix misuse of IS_NEWER_THAN in timestamp check
When using a file system which only has second resolution timestamps, there is a reasonably high likelihood of timestamps being the same. The IS_NEWER_THAN test returns true when timestamps are the same, so don't retry copying the PCH PDB file when they match exactly.
This commit is contained in:
@@ -2698,8 +2698,9 @@ void cmLocalGenerator::CopyPchCompilePdb(
|
||||
}
|
||||
|
||||
file << "foreach(retry RANGE 1 30)\n";
|
||||
file << " if (EXISTS \"" << from_file << "\" AND \"" << from_file
|
||||
<< " \" IS_NEWER_THAN \"" << dest_file << "\")\n";
|
||||
file << " if (EXISTS \"" << from_file << "\" AND (NOT EXISTS \""
|
||||
<< dest_file << "\" OR NOT \"" << dest_file << " \" IS_NEWER_THAN \""
|
||||
<< from_file << "\"))\n";
|
||||
file << " execute_process(COMMAND ${CMAKE_COMMAND} -E copy";
|
||||
file << " \"" << from_file << "\""
|
||||
<< " \"" << to_dir << "\" RESULT_VARIABLE result "
|
||||
|
||||
Reference in New Issue
Block a user