diff options
author | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2020-12-22 15:29:56 +0100 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2020-12-22 08:22:16 -0800 |
commit | 283c1971b2ae484fbfe2c279446f3612004f7c7a (patch) | |
tree | 0e84d90bb68820f74823b2340e8dd00a118a33e9 /tools | |
parent | 219efb1179d9755b243adf69519a1344433bd964 (diff) | |
download | rabbitmq-c-283c1971b2ae484fbfe2c279446f3612004f7c7a.tar.gz |
Use cmake TIMESTAMP function
to allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Also use UTC to be independent of timezone.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/CMakeLists.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 7609cd3..1b09975 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -45,9 +45,10 @@ if (BUILD_TOOLS_DOCS) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc) set(XMLTO_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doc/man-date.ent) + STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC) add_custom_command( OUTPUT ${XMLTO_DEPENDS} - COMMAND date +'%Y-%m-%d' > ${XMLTO_DEPENDS} + COMMAND echo ${BUILD_DATE} > ${XMLTO_DEPENDS} VERBATIM ) |