Fix cgo bullshit in build

This commit is contained in:
bdnugget 2025-01-19 23:28:04 +01:00
parent 31ae9c525f
commit 4549ee7517

View File

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