Skip to content

Cross compiling

Linus Weber edited this page Mar 4, 2023 · 10 revisions

Cross-compiling

Dependencies (Fedora 30)

sudo dnf install make git golang SDL2{,_gfx,_image,_ttf,_mixer} mingw64-SDL2{,_image,_ttf}

Dependencies (WSL2 using Debian 11)

sudo apt install git golang libsdl2{,-gfx,-image,-ttf}-dev fonts-dejavu mingw-w64

Installing SDL2_gfx library

This is probably not necessary anymore.

wget http://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz
tar xf SDL2_gfx-1.0.4.tar.gz
cd SDL2_gfx-1.0.4
mingw64-configure
mingw64-make
sudo mingw64-make install
cd ..

Cloning the repository

git clone https://github.com/Linus4/csgoverview.git
cd csgoverview

Regenerate rsrc.syso for icon (optional)

Present file automatically included by go build: https://github.com/akavel/rsrc.

rsrc -arch amd64 -ico "csgoverview.ico"

Build

CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -trimpath -tags static -ldflags "-s -w -H windowsgui"

You can leave out -H windowsgui if you want to launch csgoverview from the command-line and see error messages for debugging.