Detect iOS Simulator with QMake. How?
-
Hello all!
In one of later projects been using this in *.pro file for detecting iOS Simulator:
ios { message(iOS) } simulator { message(Simulator) }For now it's not working properly. Message appearing for both iOS Device and iOS Simulator.
Is there any way to detect when iOS Simulator and when iOS Device?The global problem for now is that new M1 Macbook/iMac is arm64 and therefore appearing conflict when you using arm64 for iPhone and arm64 for Simulator. Previously been using fat *.a static lib where were arm64 and x86_64 for all of them. For now for Simulator it might be arm64 and x86_64 and for iPhone arm64. "lipo" making error because of duplicated arch.
Is there any info how to solve this issue?
-
Solution found.
CONFIG(iphoneos,iphoneos|iphonesimulator):message(Detect iphoneos) CONFIG(iphonesimulator,iphoneos|iphonesimulator):message(Detect iphonesimulator)In case of using for different iOS Simulators arch might be used "$$QMAKE_HOST.arch".
equals($$QMAKE_HOST.arch,arm64):message(Detect arm64) equals($$QMAKE_HOST.arch,x86_64):message(Detect x86_64)