If you try to use a 3rd party library (compiled using make or cmake) in your iOS 13 project and turn on the "UIKit For Mac" option, Xcode will be unhappy about the library. It will complain that the provided library is compiled for the wrong architecture (if you point it to the iphoneos version). Or, it will complain that it is compiled for the wrong platform (if you point it to the simulator or Mac version). What settings do I need to specify in the Makefile to make Xcode to accept the library under the "UIKit For Mac" option?
Well, after digging around for a while, I found out that if you supply clang with the following target (set the CFLAGS
variable before calling configure
), it compiles the right version of the library (note the -macabi
suffix):
-target x86_64-apple-ios${MIN_IOS_VERSION}-macabi
I also add the minimum os version flag to the macOS version:
-mmacosx-version-min=${MIN_OSX_VERSION}
Here MIN_IOS_VERSION="13.0"
and MIN_OSX_VERSION="10.15"