Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.85k stars 225 forks source link

Meson build: Support ARM Macs by default #607

Closed Macil closed 1 year ago

Macil commented 1 year ago

This PR makes it so that the Mac build instructions of meson build && ninja -C build just work even on modern ARM Macs where Homebrew installs libraries to /opt/homebrew/lib. This makes the extra instructions in the readme for ARM Macs unnecessary. The build still works for non-ARM Macs too.

(Only the cc.find_library() call for MoltenVK had to be changed. It was the only cc.find_library() call for a brew-installed dependency. The other brew-installed dependencies were found through the dependency() function, which I think is able to find brew-installed libraries by default.)

This is basically the same change I made to the Makefile in https://github.com/Novum/vkQuake/pull/330 redone for the new Meson build script.

Macil commented 1 year ago

Huh, CI is telling me that I'm wrong about this not breaking non-ARM Macs. I'll figure this out and update the PR soon.

Macil commented 1 year ago

I've fixed my PR now. (It turns out that Meson's find_library() function actually skips checking normal library locations if you specify any "extra" directories to check, so it's not actually safe to list extra directories to check that aren't always used.)