Yep! I’ve actually done this for work, getting GitLab’s CI runner to compile windows binaries for me.
The easiest method is with cross. You can do cross-compilation without it, but you need a C compiler and linker that works for the target, the
cross tool just automates this by using pre-generated docker images (this will require installing docker,
sudo apt-get install docker).
Once you have
docker installed and running, you can cross-compile just by doing
cross build --target x86_64-pc-windows-gnu
cross tool just wraps
cargo to run the job inside the appropriate docker container)