Libcairo on macOS arm64

Hi folks, big fan here. I recently got a new M4 MacBook Pro and ported all my apps to universal binaries, except one app that uses libcairo.a. Unsure, I cloned and built cinder 0.9.3 without too many problems (one compile error), but it finally built.

In my app as well as the samples/_svg apps, I have to change the architecture to x86_64 and use Rosetta, otherwise I get a warning that libcairo.a has no support for arm64 architecture, and lots of link errors.

So, I was wondering if there is a way to get libcairo.a to support arm64 architecture(s)?

I haven’t been on mac for years, but I was using it a lot around the time where you’d run into this issue with 32-bit precompiled libraries and needing to update them to x86_64 ones.

Obviously cairo being open source you could just download and build it yourself and grab the files you need, but the first thing I would usually try is to install them via homebrew.

I’m assuming you have homebrew installed as it’s pretty much a defacto standard on mac for developers as far as I know, so with that assumption if you run brew install cairo you should (hopefully) wind up with some arm64 binaries you can link against.

Thanks lithium! First, I had to update homebrew, then no errors with “brew install cairo” - however what it made is not a direct replacement, as it generated .dylib files for (only) arm64 architecture. I’ll have to try using those!