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

One-line fix:

git clone [email protected]: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 [email protected]: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 [email protected]: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"