编译WebRTC首先得下载源代码。1.先安装git ,mac下安装XCODE自带git
2.下载编译工具 depot_tools,
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
3.设置环境变量
export PATH=$PATH:`pwd`/depot_tools
4.下载源码
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc_ios
gclient sync
下载完成后就开始编译工作
1.编译静态库
gn gen out/mac --args='is_debug=false target_os="mac" target_cpu="x64"' --ide=xcode
ninja -C out/mac AppRTCMobile
2.合并静态库 ,将编译完的静态库合并为一个.a
mkdir ./lib
find ./ -name *.a exec cp {} ./l