My project is arranged like this:
The static library is going to start depending on the GoogleWebRTC framework. Unfortunately, this dependency can only be built as a framework via 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?
Some solutions that come to mind are:
include "<WebRTC/WebRTC.h>
works. Then embedding and linking the library in the App target It's unfortunate decision on Google's part to remove static target.
if that helps, you can use mesibo webrtc framework which is a static framework build using modified ninja files . Only downside is, it is not as regularly updated as Google build (typically lags by a month old sync).
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
.
Below is the difference you will see in Mesibo and Google Version of WebRTC framework
Mesibo version
$ 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!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.