在对 2019 年 WWDC 公告感到兴奋之后,我尝试使用 Xcode 11.0 beta 针对 MacOS 编译现有的 iOS 应用程序。不幸的是,事情并没有按预期进行。
Xcode 说我的静态库是为 架构构建的:
为 Mac 版 UIKit 构建,但链接库“libssl.a”是
为而建。您可能需要限制平台
该库应该在目标编辑器中链接。
But when I check my static libs, I can see they do contain the desired architecture x86_64
:
我相信这个问题可能与 Xcode Beta 错误有关。有人对此有什么想法吗?
一行修复:
git clone [email protected] /cdn-cgi/l/email-protection:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --archs="MacOSX_x86_64 i386 arm64 armv7s armv7"
解释:
根据edford,苹果的软件工程师,我们需要为iOS平台构建我们的二进制文件,目标MacOSX
并使用CFLAG
-target x86_64-apple-ios13.0-macabi
。这里有一个非常有启发性的讨论:https://forums.developer.apple.com/message/362577 https://forums.developer.apple.com/message/362577.
我已经分叉了 OpenSSL-for-iPhonehere https://github.com/marcelosalloum/OpenSSL-for-iPhone并在分支机构实施了 MacCatalyst 支持feature/mac-catalyst
.
你可以构建它MacCatalyst
要么通过指定archs
or targets
:
Option --archs
,对于 OpenSSL
git clone [email protected] /cdn-cgi/l/email-protection: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
对于 OpenSSL >= 1.1.0
git clone [email protected] /cdn-cgi/l/email-protection: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"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)