summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/PolicyScope
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-02-18 01:31:48 (GMT)
committerBrad King <brad.king@kitware.com>2021-02-22 16:02:20 (GMT)
commitb0da6712439fe44d84a158dceb5f946cc30ef68a (patch)
treed12768dcd5e02057096eba1e77f3926d1228fc3b /Tests/RunCMake/PolicyScope
parent404cddb7bbb0e05bba2f3023f0ee2fa302c35124 (diff)
downloadCMake-b0da6712439fe44d84a158dceb5f946cc30ef68a.zip
CMake-b0da6712439fe44d84a158dceb5f946cc30ef68a.tar.gz
CMake-b0da6712439fe44d84a158dceb5f946cc30ef68a.tar.bz2
FetchContent: Don't update timestamps if files don't change
The refactoring in 17e5516e60 (FetchContent: Invoke steps directly and avoid a separate sub-build, 2021-01-29) uses a different way of writing out the step scripts and updating time stamps when steps are executed. That inadvertently always wrote out the scripts for custom commands, even when the contents didn't change. This caused their timestamp to always be updated, resulting in those steps always being seen as out-of-date and needing to be re-executed. The way timestamps were checked to determine whether to re-execute a step also did not adequately account for file systems which only have second-resolution timestamps. The IS_NEWER_THAN if condition also returns true when timestamps are the same, so one needs to use the negative form to get a true "is newer than" test. ExternalProject is not susceptible to this problem because it uses file(GENERATE) to write out the script files and that only updates the file's timestamp if the contents change. It also mostly leaves timestamp checking to the build tool.
Diffstat (limited to 'Tests/RunCMake/PolicyScope')
0 files changed, 0 insertions, 0 deletions