需要翻墙下载代码
1、depot_tools:
https://chromium.googlesource.com/chromium/tools/depot_tools.git
环境变量配置: depot_tools、【python 2.7.6】 注意环境变量
a、把depot_tools目录加入PATH:export PATH=`pwd`/depot_tools:"$PATH"
b、安装”Visual Studio 2015 Update 3“,zh。
c、set DEPOT_TOOLS_WIN_TOOLCHAIN=0
2、cmd.exe中运行gclient
3、配置git
git config --global user.name "My Name"
git config --global user.email "my-name@chromium.org"
git config --global core.autocrlf false
git config --global core.filemode false
git config --global branch.autosetuprebase always
4、建立文件夹 mkdir webrtc-checkout && cd webrtc-checkout
5、拉取代码 fetch --nohooks webrtc
6、gclient sync
7、进入源码目录 cd src
8、git checkout master (git pull)
9、gclient sync
10、gn gen out/Default
release:gn gen out/Default --args='is_debug=false'
11、ninja -C out/Default
如果要生成vs项目工程,则:
$ gn gen --ide=vs out\Default$ devenv out\Default\all.sln
gn ls out/Default
To update an existing checkout, you can run
$ git rebase-update$ gclient sync
错误解决:
Exception: dbgcore.dll not found in "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbgcore.dll"
Exception: dbghelp.dll not found in "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll"
You must install the "Debugging Tools for Windows" feature from the Windows 10 SDK.
ERROR at //build/toolchain/win/BUILD.gn:39:3: Script returned non-zero exit code exec_script("../../vs_toolchain.py",
e:\opensource\webrtc\webrtc-checkout\src\third_party\gflags\src\src\windows_port.h(54): fatal error C1083: 无法打开包括文件: “windows.h”: No such file or directory
需要下载安装:Windows 10 SDK (ver. 10.0.14393.795)
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
可以参考:
http://blog.csdn.net/yangzhenping/article/details/52399897
Checking out and Building Chromium for Windows
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Get-the-code
https://webrtc.org/native-code/development/