Set build timestamp when building libsyncthing to avoid default `1970-01-…`

This commit is contained in:
Martchus 2023-09-01 16:33:21 +02:00
parent 89caa76102
commit 7cc541d542
1 changed files with 4 additions and 1 deletions

View File

@ -160,8 +160,11 @@ if (BUILD_HOST)
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Host=${BUILD_HOST}")
endif ()
if (DEFINED $ENV{BUILD_STAMP})
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Stamp=$ENV{BUILD_STAMP}")
set(BUILD_STAMP "$ENV{BUILD_STAMP}")
else ()
string(TIMESTAMP BUILD_STAMP "%s" UTC)
endif ()
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Stamp=${BUILD_STAMP}")
# generate Syncthing's assets (not setting GOARCH/GOOS here, this is supposed to run on the host)
add_custom_command(