CMake: avoid including file modification time for RCC

Resources such as translations (autogenerated qm files) and SVG images
resulted in non-reproducible builds. Be sure to disable this to make the
resources reproducible on Qt < 5.8 or Qt >= 5.9 (excluding Qt 5.8.x).

With this change, the Wireshark build is reproducible invariant of the
build directory (but not the source directory).

Bug: 15163
Change-Id: I9240d2aa6e7298e1928c0f1d97ce83673320024d
Reviewed-on: https://code.wireshark.org/review/31593
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Peter Wu 2019-01-18 13:39:41 +01:00
parent d9fa91f0fd
commit 10ef540405
1 changed files with 9 additions and 0 deletions

View File

@ -592,6 +592,15 @@ set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
if(NOT Qt5Widgets_VERSION VERSION_LESS "5.9")
# Drop the file modification time of source files from generated files
# to help with reproducible builds. We do not use QFileInfo.lastModified
# so this has no unwanted side effects. This mtime started appearing in
# Qt 5.8. The option to force the old file format without mtime was
# added in Qt 5.9. See https://bugreports.qt.io/browse/QTBUG-58769
set(CMAKE_AUTORCC_OPTIONS --format-version 1)
endif()
QT5_ADD_TRANSLATION(WIRESHARK_QT_QM ${WIRESHARK_QT_TS})
add_custom_target(