FetchContent: Don't update verify script timestamp if it doesn't change

Fixes: #26255
This commit is contained in:
Craig Scott 2024-09-06 15:53:48 +10:00
parent 795e7b44f2
commit cbb727ca6b
No known key found for this signature in database
GPG Key ID: 6FF37CBDCCADED9F

View File

@ -1221,7 +1221,9 @@ hash=${hash}
endif ()
set(comment "Performing download step (${steps}) for '${name}'")
# already verified by 'download_script'
file(WRITE "${verify_script}" "")
# We use file(CONFIGURE) instead of file(WRITE) to avoid updating the
# timestamp when the file already existed and was empty.
file(CONFIGURE OUTPUT "${verify_script}" CONTENT "")
# Rather than adding everything to the RepositoryInfo.txt file, it is
# more robust to just depend on the download script. That way, we will