[英]Weak linking a framework to a static library
My project is arranged like this: 我的项目安排如下:
The static library is going to start depending on the GoogleWebRTC framework. 静态库将根据GoogleWebRTC框架启动。 Unfortunately, this dependency can only be built as a framework via WebRTC.org .
不幸的是,这种依赖只能通过WebRTC.org构建为框架。 They removed the ability to build as a static library for maintenance reasons.
由于维护原因,他们删除了构建为静态库的功能。
Is is possble for the static library to weakly link to the GoogleWebRTC framework? 静态库是否可以弱链接到GoogleWebRTC框架?
Some solutions that come to mind are: 我想到的一些解决方案是:
include "<WebRTC/WebRTC.h>
works. Then embedding and linking the library in the App target include "<WebRTC/WebRTC.h>
起作用。然后将库嵌入并链接到App目标中 It's unfortunate decision on Google's part to remove static target. 对于Google而言,删除静态目标是不幸的决定。
if that helps, you can use mesibo webrtc framework which is a static framework build using modified ninja files . 如果有帮助,您可以使用mesibo webrtc框架,该框架是使用修改后的ninja文件构建的静态框架 。 Only downside is, it is not as regularly updated as Google build (typically lags by a month old sync).
唯一的缺点是,它不像Google构建那样定期更新(通常会延迟一个月的同步)。
https://github.com/mesibo/mesibowebrtcframework https://github.com/mesibo/mesibowebrtcframework
All you have to do is to copy WebRTC.framework/WebRTC
from mesibo version which is nothing but a static library, extract using lipo -extract
and repackage it with your own library using lipo -create
. 所有你需要做的就是复制
WebRTC.framework/WebRTC
使用从mesibo版本,这不过是一个静态库,提取lipo -extract
并使用与自己的库重新包装lipo -create
。
Below is the difference you will see in Mesibo and Google Version of WebRTC framework 以下是您将在Mesibo和Google版本的WebRTC框架中看到的区别
Mesibo version Mesibo版本
$ file WebRTC.framework/WebRTC
WebRTC.framework/WebRTC: Mach-O universal binary with 4 architectures: [i386:current ar
archive random library] [arm64]
WebRTC.framework/WebRTC (for architecture i386): current ar archive random library
WebRTC.framework/WebRTC (for architecture armv7): current ar archive random library
WebRTC.framework/WebRTC (for architecture x86_64): current ar archive random library
WebRTC.framework/WebRTC (for architecture arm64): current ar archive random library
And Google Version 和谷歌版本
$ file WebRTC.framework/WebRTC
WebRTC.framework/WebRTC: Mach-O universal binary with 4 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64]
WebRTC.framework/WebRTC (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
WebRTC.framework/WebRTC (for architecture i386): Mach-O dynamically linked shared library i386
WebRTC.framework/WebRTC (for architecture armv7): Mach-O dynamically linked shared library arm_v7
WebRTC.framework/WebRTC (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
Let me know if you need more inputs! 让我知道您是否需要更多输入!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.