#!/bin/sh # Build ffxiv-tiny-launcher (Windows-only; optionally pass a GOARCH): # ./build.sh # -> dist/ffxiv-tiny-launcher-windows_amd64.exe # ./build.sh arm64 # -> dist/ffxiv-tiny-launcher-windows_arm64.exe # # Pure Go (CGO_ENABLED=0): winc drives native Win32 controls via P/Invoke, so # the binary has no native dependencies and no runtime packages to install. # Run the .exe inside a full Windows environment such as GameNative; it starts # the game natively in that same environment. Logs go to stderr and to # launcher.log next to the executable (a windowsgui build has no console). set -eu cd "$(dirname "$0")" arch=${1:-amd64} out="dist/ffxiv-tiny-launcher-windows_$arch.exe" # Stamp the commit hash into the binary so launcher.log's first line proves # which build a test round actually ran. buildid=$(git rev-parse --short HEAD 2>/dev/null || echo nogit) mkdir -p dist CGO_ENABLED=0 GOOS=windows GOARCH="$arch" \ go build -trimpath -ldflags="-s -w -X main.buildID=$buildid" -o "$out" . echo "built $out (buildID=$buildid)"