Cross-Compiling Plugins

Up until now I’ve been working on both a Linux (Ubuntu) laptop and a Windows desktop machine. I compile and test my plugins for both linux and windows, and rely on very helpful others in the community to compile for Mac, so that people can get my plugins before they land in the plugin manager.

Going forward windows may not be a practical option for me, so I was wondering if anyone is successfully cross-compiling windows and mac versions on a linux installation. If so, I would appreciate some pointers.

Obviously ‘cross-testing’ is not on my wishlist.

I think Andrew is cross compiling that way, from Linux.

I use Arch Linux with Docker with Ubuntu 16.04 for Linux, mingw-w64 for Windows, and oscross with the MacOS 10.11 SDK for Mac.

2 Likes

Similar to Andrew’s setup I can cross compile on Linux to Windows and Mac. Windows is no problem at all with mingw. Mac is a little more involved to set up the osxcross tool chain and technically requires you to have a Mac and access to the SDKs (licensing).

Well, i didnt do mac compilation previously, so its no great loss. I’ll look into mingw on linux. Thank you for the hint.

Does any of you guys has a small example on how to cross compile for windows using Linux?

I’m particularly interested in the environment configuration necessary for building the binaries correctly.

1 Like

Windows is the easiest, thanks to Mingw64.

CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ STRIP=x86_64-w64-mingw32-strip RACK_DIR=... make -j$(nproc) dist

Another approach: use a CI system that can compile for other archs. This thread is how I do it, and it has details on doing it with Azure builds as well.

2 Likes

Thanks! Seems to work fine. I can compile the binaries in my Linux Vm.

Anyone have a working Dockerfile for OS X cross-compilation they feel like sharing? It looks like the obvious published osxcross images on Dockerhub are pretty old (Debian Jessie, 10.8.)

I’ve got a GitHub Actions setup that, on every merge to master, builds Windows and Linux and posts them on the GitHub releases page, in case that’s helpful for anyone. If you’re in the GitHub Actions beta you can probably reuse this workflow with little to no modifications.
https://github.com/Dewb/monome-rack/tree/master/.github