Skip to content

Example using mutliarch/crossbuild to build rust binaries for linux, macos, and windows

License

Notifications You must be signed in to change notification settings

zmoazeni/rust-crossbuild

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of cross compiling Rust

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.

How to use it

Run ./buildall.sh to build all binaries.

How this works

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.

Legal note

OSX/Darwin/Apple builds: Please ensure you have read and understood the Xcode license terms before continuing.

License

MIT

About

Example using mutliarch/crossbuild to build rust binaries for linux, macos, and windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published