emcrisostomo / fswatch

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
https://emcrisostomo.github.io/fswatch/
GNU General Public License v3.0
4.96k stars 327 forks source link

Universal (Arm + x86) library build for MacOS on M1 #293

Closed man-in-black382 closed 8 months ago

man-in-black382 commented 1 year ago

Hi. Make seems to be only building current architecture. I'm building on an M1 machine, the resulting dylib is Arm-only and I'd like to have a library that works across all MacOS architectures. Is it possible to do that with Make?

I also tried building with cmake and there's a list of architectures one can provide, which is what I need. But, there's is a dependency on libintl_gettext library. libintl_gettext can be installed using homebrew, but it is also Arm-only (on my machine), so linking of libfswatch fails for x86 architecture (but goes fine for arm).

What is the better way to build a universal dylib of libfswatch on MacOS for MacOS?

Thank you!

man-in-black382 commented 8 months ago

Building separately for each architecture and then lipo'ing would be a solution