Xcode 11 not recognizing static library's architecture: MacCatalyst (aka UIKitForMac)

隐身守侯 提交于 2019-12-05 09:25:38

One-line fix:

git clone git@github.com:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --archs="MacOSX_x86_64 i386 arm64 armv7s armv7"

Explanation:

According to edford, Apple's software engineer, we need to build our binaries for the iOS platform, targeting MacOSX and use the CFLAG -target x86_64-apple-ios13.0-macabi. There is a very enlightening discussion here: https://forums.developer.apple.com/message/362577.

I've forked OpenSSL-for-iPhone here and implemented MacCatalyst support in the branch feature/mac-catalyst.

You can build it for MacCatalyst either by specifying archs or targets:

Option --archs, for OpenSSL <= 1.0.2:

git clone git@github.com:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --archs="MacOSX_x86_64 i386 arm64 armv7s armv7"  --version="1.0.2l"

Option --targets for OpenSSL >= 1.1.0

git clone git@github.com:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --targets="ios-sim-cross-i386 ios64-cross-arm64 ios-cross-armv7s ios-cross-armv7 mac-catalyst-x86_64" --version="1.1.0"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!