mirror of https://github.com/tidwall/tile38.git
fixed ldflags
This commit is contained in:
parent
95125e0a04
commit
162528bdeb
15
build.sh
15
build.sh
|
@ -4,6 +4,14 @@ set -e
|
||||||
VERSION="0.0.1"
|
VERSION="0.0.1"
|
||||||
PROTECTED_MODE="no"
|
PROTECTED_MODE="no"
|
||||||
|
|
||||||
|
# Hardcode some values to the core package
|
||||||
|
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}"
|
||||||
|
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=$(git rev-parse --short HEAD)"
|
||||||
|
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)"
|
||||||
|
if [ "$PROTECTED_MODE" == "no" ]; then
|
||||||
|
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
|
||||||
|
fi
|
||||||
|
|
||||||
export GO15VENDOREXPERIMENT=1
|
export GO15VENDOREXPERIMENT=1
|
||||||
|
|
||||||
cd $(dirname "${BASH_SOURCE[0]}")
|
cd $(dirname "${BASH_SOURCE[0]}")
|
||||||
|
@ -32,13 +40,6 @@ fi
|
||||||
|
|
||||||
core/gen.sh
|
core/gen.sh
|
||||||
|
|
||||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}"
|
|
||||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=$(git rev-parse --short HEAD)"
|
|
||||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)"
|
|
||||||
if [ "$PROTECTED_MODE" == "no" ]; then
|
|
||||||
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# build and store objects into original directory.
|
# build and store objects into original directory.
|
||||||
go build -ldflags "$LDFLAGS" -o "$OD/tile38-server" cmd/tile38-server/*.go
|
go build -ldflags "$LDFLAGS" -o "$OD/tile38-server" cmd/tile38-server/*.go
|
||||||
go build -ldflags "$LDFLAGS" -o "$OD/tile38-cli" cmd/tile38-cli/*.go
|
go build -ldflags "$LDFLAGS" -o "$OD/tile38-cli" cmd/tile38-cli/*.go
|
||||||
|
|
Loading…
Reference in New Issue