This commit is contained in:
HappyHakunaMatata 2025-04-25 15:16:45 +02:00
parent 47818a1a7c
commit d8e32e5661
3 changed files with 408 additions and 1 deletions

15
build
View file

@ -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