webrtc是google開源的代碼,但是代碼都放在google的服務器上,然後有牆懂的都懂
mkdir webrtc
cd webrtc
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
#需要設置一個臨時的環境變量或者寫到.bash_profile或者.zshrc裏
export WORKSPACE=$(pwd)\nexport
PATH=$WORKSPACE/depot_tools:$PATH
cd depot_tools
# 掛了V 下載還挺快的
fetch --nohooks webrtc
# 這裏拉了半天代碼
gclient sync
#代碼管理
git config branch.autosetupmerge always
#創建自己的分支
git branch rtc_study
#切到自己的分支
git checkout rtc_study
#生成xcode工程
cd src
#加上ios_enable_code_signing=false 和 rtc_include_tests=false 可避免報錯Assignment had no effect
gn gen out/ios --args='target_os="ios" target_cpu="arm64" is_component_build=false ios_enable_code_signing=false rtc_include_tests=false' --ide=xcode
#編譯項目生成.framework動態庫
ninja -C out/ios AppRTCMobile
# 編譯.a靜態庫
ninja -C out/ios webrtc