From 0f7188000195fc6b5628da7700906256efb2d7ee Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Thu, 10 Apr 2025 10:13:30 +0200 Subject: [PATCH] cmake: yaml: update timestamp on intermediate file save file(GENERATE ...) does not update the output file if the content is unchanged. Since the metadata in build_info.yml mostly depends on the build configuration, the timestamp of the intermediate file does not get updated on most rebuilds, while the final file does, due to immediate file(WRITE ...) calls. Since the latter is newer, no post-process step is executed and the file is left with commented genexes. Touching the intermediate file ensures that the post-process step is performed every time, even if the content is unchanged, restoring the expected behavior. Signed-off-by: Luca Burelli --- cmake/modules/yaml.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/modules/yaml.cmake b/cmake/modules/yaml.cmake index 76451068757..17afcd0ef0b 100644 --- a/cmake/modules/yaml.cmake +++ b/cmake/modules/yaml.cmake @@ -534,6 +534,7 @@ function(yaml_save) to_yaml("${json_content}" 0 yaml_out TEMP_GENEX) FILE(GENERATE OUTPUT ${expanded_file} CONTENT "${yaml_out}") + FILE(TOUCH ${expanded_file}) # ensure timestamp is updated even if nothing changed endif() endfunction()