iOS static lib for iPhone and Simulator with M1. How?
-
Hello!
When used XCode on M1 Macbook/iMac the static library build for iPhone arm64 and for Simulator fat lib of arm64 and x86-64 arch. Before M1 appearing for building universal library just run "lipo" and all is good. For now when trying to make fat library "lipo" not working because of equal arch in files for different platforms. Does anyone know how to make universal static lib with XCode that will be Ok for both of platforms (x86-64 and arm64/M1) on Simulator and (arm64) on iPhone?
Or how to make different config with QMake one for M1 Simulator, one for x86-64 Simulator and one for iPhone?
-
Solution found. Separate building of static library for every version of any platform and attaching it to the project in qmake by detecting it via qmake test functions. Something like this:
CONFIG(iphoneos,iphoneos|iphonesimulator):message(Detect iphoneos) CONFIG(iphonesimulator,iphoneos|iphonesimulator):message(Detect iphonesimulator) equals(QMAKE_HOST.arch, arm64):message(Detect arm64) equals(QMAKE_HOST.arch, x86_64):message(Detect x86_64)
For now built in XCode Objective-C static library with different parameters for:
- M1 arm64 Simulator
- Intel x86_64 Simulator
- arm 64 iPhone