Skip to content

Commit 0f71880

Browse files
pillo79kartben
authored andcommitted
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 <[email protected]>
1 parent 6c9e478 commit 0f71880

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmake/modules/yaml.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ function(yaml_save)
534534

535535
to_yaml("${json_content}" 0 yaml_out TEMP_GENEX)
536536
FILE(GENERATE OUTPUT ${expanded_file} CONTENT "${yaml_out}")
537+
FILE(TOUCH ${expanded_file}) # ensure timestamp is updated even if nothing changed
537538
endif()
538539
endfunction()
539540

0 commit comments

Comments
 (0)