August 29, 2014

GO cross compile Windows binary on Linux


# set up cross compilation to windows_amd64
# you only need to do this once
cd $GOROOT/src
GOOS=windows GOARCH=amd64 ./make.bash --no-clean

# whenever you want to cross compile
cd $YOUR_APP
GOOS=windows GOARCH=amd64 go build

More at
https://inconshreveable.com/04-30-2014/cross-compiling-golang-programs-with-native-libraries/

No comments:

Post a Comment