I'm working on a macOS application that deals with a few external dependencies that can only be compiled for intel (x86_64) but I want the app to run natively on both arm and x86_64.
One idea I have been playing with is to move the x86_64 dependencies to an xpc service compiled only as x86_64 and use the service only the intel machine. However, I can't figure out how to setup my project to compile everything at once...
Any ideas? Is this even possible? If not, I'm open to suggestions...
Thanks
Is this even possible?
It’s absolutely possible. Somewhere lying around on my hard disk is a test project where I did exactly this. I’d offer to share some code, but this issue isn’t about code but rather about build settings.
There are two ways to structure this:
-
You have some Intel-only code that you want to use from your universal app.
-
You have some code that you want to be architecture specific, that is, have control over whether you run the Intel or Apple silicon version.
This distinction matters because the first case needs a single XPC service (for Intel) and the second case needs two XPC services (one for Intel and one for Apple silicon).
I suspect you’re aiming for the first. Is that right?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"