Cross compiling to several OSes

I’d like to know if there are off-the-shelf, systematic solutions to build OCaml programs for various OSes (even better, I’d love to automatically publish releases for several OSes at once). In my case, I work on GNU/Linux and would like to build Mac OS and Windows 10 binaries. I suppose it should be doable with CI tools as we already have @avsm’s build scripts for Travis, right?

The easiest way right now is to use a GitHub Actions to generate the executable artefacts. See for an example.

There are various efforts going on throughout the ocaml/opam/dune stacks to simplify cross-compilation, but full “direct compilation” is a little while out as every piece of the stack has to work together. Luckily, hosted builds like GitHub Actions solve the immediate problem.


Thanks, this is the king of thing I was looking for.