RFC: Output universal binary when CMAKE_OSX_ARCHITECTURES is defined.
@alexreinking this is to start the conversation about supporting universal binaries. This patch allowed me to build Halide as a universal library and to generate filters as universal libraries from CMake.
I'm only vaguely familiar with CMake so please excuse my code :)
There's probably a better way to do this, I saw the is_crosscompiling argument but I also read somewhere that arguments to target= need to be the same architecture. I'm not sure where this requirement is coming from but this is the main reason I went with the approach of generating per architecture and fusing them together.
Basic idea is pretty simple, CMAKE_OSX_ARCHITECTURES is usually set to "arm64,x86_64" when compiling for Big Sur. Generator is invoked once per architecture and two object files are then merged into a fat file. Separate command is used to generate all the other outputs like header file, registration file, etc. Same thing is done for runtime library.
I need access to an M1 Mac to test this. @steven-johnson - can I use the buildbot for a while?
I need access to an M1 Mac to test this. @steven-johnson - can I use the buildbot for a while?
OK with me, but @abadams is the one to check with
@abadams - cool to use the M1 mac for a while? Maybe over the weekend?
Yeah, sure.
Any updates on this PR?
Is this PR still active? Should it be closed?
I haven't found a time to sit down with an Apple Silicon machine to myself and test this yet. But I would like to!