Simultaneously Compile for Win, Mac, and Linux?

Is there a way to simultaneously compile for Windows, Mac, and Linux from one of those OS using the SDK or another tool?

Right now I’m popping open a spare macbook to compile for mac and running a virtual machine to compile for Linux and it’s sort of annoying. Wondering if there is a better way for cross compilation?

1 Like

The rack plugin toolchain: GitHub - VCVRack/rack-plugin-toolchain

That’s how open source plugins get build for the library.

2 Likes

You can install that and run it in a Linux vm. It’s great.

1 Like

I used to run docker locally on linux and successfully built all three on that. But the osxcross that I was using for mac builds is not currently up to the job.

Now I use github actions - building the win and linux variants on linux VMs and the mac variant on a mac VM. Although they do provide win VMs as well

Github actions are a good solution for lots of reasons. Not for me, as I needed to make a build that is “exactly” like what’s in the library, as my windows modules were plagued with crashes that didn’t happen on my local builds, but would happen in the library.

toolchain let me make build that would also crash, so It was a good solution for me. And it let me make builds for all three platforms. Although for sure not as conveniently as github actions.

best (?) of both worlds - use the toolchain in GitHub actions on linux and win! that’s what we’ve been doing for a bit and it works wonderfully.

oh, good idea.

@qno has been super helpful with this. the surge-rack and BaconPlugs actions both do this now if you want a worked reference. (surge-rack is more complicated; BaconPlugs is just standard rack c++ code basically - here’s the yml BaconPlugs/build-plugin.yml at main · baconpaul/BaconPlugs · GitHub)

2 Likes

Paul, this is super helpful, I hope it is ok to use this yml with only a few minor tweaks?

Yeah sure absolutely! I think @qno even has it in a sample repo at vcv-plugin-cmake-example/build-plugin.yml at main · qno/vcv-plugin-cmake-example · GitHub this spot

1 Like

Thank you. Just added it to my existing plugin that I am finally updating for V2

Also thanks @qno the example repo and the use of Cmake will be very useful when II start my next collection of modules.

its great especially if you use clion!

1 Like