corrosion icon indicating copy to clipboard operation
corrosion copied to clipboard

MacOS fat binaries support

Open xTachyon opened this issue 1 year ago • 8 comments

I'm trying to compile a project under MacOS that sets -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" in order to create a fat binary. The code compiles, but in the linking step, it fails with the below message, plus a bunch of undefined symbols:

ld: warning: ignoring file /Users/.../therustlib.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

I've tried messing with Rust_CARGO_TARGET, but every time the build fails on a mismatch or another. I've even tried putting both the targets in that variable, but it doesn't seem like it's something that the corrosion accepts.

I've tried detecting the arch that we're currently compiling to with stuff like CMAKE_SYSTEM_PROCESSOR, but this seems to only be ever set to x86_64.

xTachyon avatar Jul 07 '23 20:07 xTachyon