1、安装depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
2、配置depot_tools
$ export PATH=$PATH:下载路径/depot_tools
3、下载源码
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc 不通的平台使用不同的参数 webrtc_android chromium webrtc_ios
gclient sync
如果遇到了
NOTICE: You have PROXY values set in your environment, but gsutil in depot_tools does not (yet) obey them.
Also, —no_auth prevents the normal BOTO_CONFIG environment variable from being used.
To use a proxy in this situation, please supply those settings in a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environment var.
解决方法:
随便找个地方生成一个文本文件,比如 D:\boto.cfg
在该文件中输入下面的内容(假设代理服务器是http://http.proxy.com:12345):
[Boto]
proxy= 127.0.0.1
proxy_port= 1080
然后设置环境变量
windows
set NO_AUTH_BOTO_CONFIG=D:\boto.cfg
linux
export NO_AUTH_BOTO_CONFIG=路径/boto.cfg
说明:python版本为2.7.5,开始为低版本时,会报错
4、编译
cd src/
gn gen out/Default 如果下载好了 很快就可以执行完 如果没有下载好的 会执行很久且最后执行失败
gn gen out/Default –ide=vs2015 指定ide为vs2015 这个没有测试过
ninja -C out/Default 执行编译
5、入门资料
http://blog.csdn.net/foruok/article/details/53005728
http://blog.csdn.net/guofengpu/article/details/51481604
6、
windows下载步骤:
1、安装detol_tool 并设置环境变量 执行gclient更新detol_tool
2、安装python 设置环境变量
3、在depot_tools下新建http_proxy.boto 内容如下:
[Boto]
proxy= 127.0.0.1
proxy_port= 1080
4、设置代理
set http_proxy=http://127.0.0.1:1080
set https_proxy=https://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
set NO_AUTH_BOTO_CONFIG=F:\G\code\code\depot_tool\http_proxy.boto
set GYP_GENERATORS=msvs-ninja,ninja
set GYP_MSVS_VERSION=2017
查看设置的git代理
git config --global --get https.proxy
git config --global --get http.proxy
查看set的设置的值 set 变量名
set http_proxy
set https_proxycd
netsh winhttp set proxy 127.0.0.1:1080
#cipd_client项目来源与https://github.com/luci/luci-go/tree/master/cipd/client/cipd
5、设置BOTO代理
set NO_AUTH_BOTO_CONFIG=F:\code\code\depot_tool\http_proxy.boto
6、设置不再次下载工具链:
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
7、设置生成工程环境变量:
set GYP_GENERATORS=msvs-ninja,ninja
set GYP_MSVS_VERSION=2015
8、检查git是不是可以可以翻墙 git clone
https://chromium.googlesource.com/chromium/tools/depot_tools.git
9、下载
fetch -–nohooks webrtc
gclient sync (同步时那你报问题就删那里 然后重新再下载)
gclient runhooks
10、编译前还要下载 winsdk DXSDK(这两个微软有)
编译 gn gen out/Debug
ninja -C out/Debug
git branch -r 查看
git checkout branch-heads/59
编译选项的设置
1、在webrtc.gni 文件中定了各种编译选项 2、通过gn gen out/h264Debug --args="proprietary_codecs=true" 设置编译选项 3、通过 gn args out/h264Debug --list=proprietary_codecs 查看编译选项的设置情况