This is an example of using multiarch/crossbuild to cross compile a rust binary for Linux, macos, and Windows.
Hat tip to japaric/rust-cross#22 (comment) for the inspiration.
Run ./buildall.sh
to build all binaries.
This builds a docker image based on multiarch/crossbuild including rust and rustup targets for Linux, macos, and Windows. Then runs cargo build commands passing the appropriate ENV and params.
Linux and Windows are straightforward, but with macos you have to pass an extra parameter to the linker.
OSX/Darwin/Apple builds: Please ensure you have read and understood the Xcode license terms before continuing.
MIT