Replies: 2 comments 2 replies
-
It cannot be done reliably without either two build directories or else per project opt-in, because there are projects which do code generation based on the host_machine (whether that is generating C sources or generating headers doesn't matter, but both are things that happen), so you'd have to know on a per project basis that none of that is happening. And if you do know that, then if memory serves correctly, universal binary advocates say you should pass both -arch flags at the same time, and the Apple compiler will do two compilation passes and fuse the results itself, without the need for I'm not certain what the answer to this general topic is. :( |
Beta Was this translation helpful? Give feedback.
-
@rgommers I seem to recall you've talked about universal binary fusing before? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I can tell, meson does not currently build fat binaries. I've found that I can do it like this (this is building a python extension, but presumably it works for any shared module?):
While this is straightforward it is annoying to have to make this conditional on the platform. Other sources I've seen have recommended creating two different meson build directories and using a cross file per arch -- but that seems way more annoying.
My thought is maybe shared_module et al could get a 'build_universal' flag, or maybe a global setting could be set that would cause any targets to just transparently generate the above rules? This certainly feels like a common use case that would simplify building fat binaries on macos.
Beta Was this translation helpful? Give feedback.
All reactions