Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:

- name: Build binary
env:
CGO_ENABLED: 0
CGO_ENABLED: 1
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
VERSION: ${{ steps.version.outputs.version }}
Expand All @@ -189,6 +189,13 @@ jobs:
OUTPUT_DIR="build/iptw-$VERSION-$GOOS-$GOARCH"
mkdir -p "$OUTPUT_DIR"

# fyne.io/systray requires CGO on macOS (Objective-C/Cocoa).
# When cross-compiling for amd64 on an arm64 runner, pass -arch x86_64 to clang.
if [ "$GOARCH" = "amd64" ]; then
export CGO_CFLAGS="-arch x86_64"
export CGO_LDFLAGS="-arch x86_64"
fi

LDFLAGS="-X main.Version=$VERSION -X main.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -X main.GitCommit=$(git rev-parse --short HEAD) -w -s"

echo "Building for $GOOS/$GOARCH..."
Expand Down