I have a fat iOS library which supports both real devices (arm64...) and iOS simulator of Intel Mac (x86_64). But when I switched to M1 mac, things get tough.
If I use the old library, I will fail with error saying xxx.a (xxx.o) building for iOS Simulator, but linking in object file built for iOS, file 'xxx' for architecture arm64
. It seems that I have to build a xcframework which contains binaries for different destinations.
So I tried to build different slices and hope to bundle them as a xcframework. But I finally found I don't know how to build the x86_64 slice with a M1 Mac.
My question is
- how to build a static library on M1 mac that supports iOS simulator of Intel Mac?
- Or was my thinking wrong from the beginning?