Applied cmake SOURCE_DATE_EPOCH patch for reproducible builds.

This commit is contained in:
mjbudd77 2022-01-15 21:12:02 -05:00
parent bb4b88d00e
commit f6e184952b
2 changed files with 13 additions and 1 deletions

View File

@ -556,6 +556,13 @@ set(SRC_DRIVERS_SDL
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_SDL})
# Put build timestamp into BUILD_TS environment variable and from there into
# the FCEUX_BUILD_TIMESTAMP preprocessor definition.
# Note: with CMake >= 3.8.0, this will respect SOURCE_DATE_EPOCH. For more info,
# see <https://reproducible-builds.org/docs/source-date-epoch/>.
string(TIMESTAMP BUILD_TS "%H:%M:%S %b %d %Y")
add_definitions( -DFCEUX_BUILD_TIMESTAMP=\"${BUILD_TS}\" )
if (WIN32)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp

View File

@ -13,6 +13,10 @@
static char *aboutString = 0;
#ifndef FCEUX_BUILD_TIMESTAMP
#define FCEUX_BUILD_TIMESTAMP __TIME__ " " __DATE__
#endif
// returns a string suitable for use in an aboutbox
const char *FCEUI_GetAboutString(void)
{
@ -48,7 +52,8 @@ const char *FCEUI_GetAboutString(void)
"of NES emulation. In Memoriam --\n"
"ugetab\n"
"\n"
__TIME__ " " __DATE__ "\n";
"\n"
FCEUX_BUILD_TIMESTAMP "\n";
if (aboutString) return aboutString;