Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ if [ -z $TABLES ] && [ -z $DEBUG ]; then
LDFLAGS="$LDFLAGS -s -w"
fi

if [[ "$CGO_ENABLED" == "1" ]]; then
LIBNAME="ygglibrary"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
LIBNAME="$LIBNAME.so"
echo "Building: $LIBNAME"
elif [[ "$OSTYPE" == "darwin"* ]]; then
LIBNAME="$LIBNAME.dylib"
echo "Building: $LIBNAME"
elif [[ "$OSTYPE" == "win32" ]]; then
LIBNAME="$LIBNAME.dll"
echo "Building: $LIBNAME"
fi
go build -ldflags="$LDFLAGS" -buildmode=c-shared -o="$LIBNAME" ./export
fi

for CMD in yggdrasil yggdrasilctl ; do
echo "Building: $CMD"
go build $ARGS -ldflags="$LDFLAGS" -gcflags="$GCFLAGS" ./cmd/$CMD
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/golang:alpine as builder
FROM docker.io/golang:alpine AS builder

COPY . /src
WORKDIR /src
Expand Down
Loading
Loading