Problem
My project is arranged like this:
- App
- Framework
- Static library (common code)
- Framework
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.
Question
Is is possble for the static library to weakly link to the GoogleWebRTC framework?
- App
- Framework
- Static library ("CommonCode")
- GoogleWebRTC
- Framework
Some solutions that come to mind are:
- Including the WebRTC header files in the static library, and build with a custom modulemap so that the
include "<WebRTC/WebRTC.h>
works. Then embedding and linking the library in the App target - Somehow converting the GoogleWebRTC.framework to a static library and embed the headers and binary in the "CommonCode" static lib
- I... can't remember the other solution I had in mind. I'll update this when I remember.
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 usinglipo -extract
and repackage it with your own library usinglipo -create
.Below is the difference you will see in Mesibo and Google Version of WebRTC framework
Mesibo version
And Google Version
Let me know if you need more inputs!