From 4549ee7517978df0da452369e3c2352d21e6b123 Mon Sep 17 00:00:00 2001 From: bdnugget Date: Sun, 19 Jan 2025 23:28:04 +0100 Subject: [PATCH] Fix cgo bullshit in build --- scripts/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/build.sh b/scripts/build.sh index 4d028a8..c0e9d2a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -6,6 +6,14 @@ build() { local arch=$2 local output=$3 + # Set GOOS and GOARCH for cross-compilation + export GOOS=$os + export GOARCH=$arch + + # Disable CGO only for cross-compilation + if [ "$os" != "$(go env GOOS)" ] || [ "$arch" != "$(go env GOARCH)" ]; then + export CGO_ENABLED=0 + fi if [ "$os" = "windows" ]; then export CC=x86_64-w64-mingw32-gcc