1趾徽、設(shè)置git
git config --global http.proxy http://127.0.0.1:21882
git config --global https.proxy https://127.0.0.1:21882
git config --global http.postBuffer 1048576000
git config --global http.lowSpeedLimit 0??
git config --global http.lowSpeedTime 999999? //一定要設(shè)置超時時間
2、設(shè)置vpn
set http_proxy=127.0.0.1:21882
set https_proxy=127.0.0.1:21882
3、設(shè)置vs編譯
set vs2019_install=D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
set GYP_MSVS_OVERRIDE_PATH=D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
set WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10
# 以上三個環(huán)境變量,就算有空格凡橱,也不需要使用雙引號瀑粥,否則會報錯
set GYP_GENERATORS=msvs-ninja,ninja
# 告訴depot_tools使用我們本機(jī)的VS進(jìn)行編譯
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
4、下載源碼
下載depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc? #下載約10G的內(nèi)容衷咽,漫長的等待,網(wǎng)絡(luò)不好的情況下會重試幾次
gclient sync
5蒜绽、切換分支
git checkout -b m99 refs/remotes/branch-heads/4844
gclient sync
5镶骗、編譯
cd src
#開啟 h264 編碼支持
gn gen --ide=vs2022 --args="proprietary_codecs=true rtc_use_h264=true is_clang = true rtc_include_tests=false " out/Default
gn gen --ide=vs2022 out/Default
ninja -C out/Default? ? ? ? ? ? #編譯十幾分鐘