Set build timestamp when building libsyncthing to avoid default `1970-01-…`
This commit is contained in:
parent
89caa76102
commit
7cc541d542
|
@ -160,8 +160,11 @@ if (BUILD_HOST)
|
||||||
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Host=${BUILD_HOST}")
|
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Host=${BUILD_HOST}")
|
||||||
endif ()
|
endif ()
|
||||||
if (DEFINED $ENV{BUILD_STAMP})
|
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 ()
|
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)
|
# generate Syncthing's assets (not setting GOARCH/GOOS here, this is supposed to run on the host)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|
Loading…
Reference in New Issue