1. 准备
http://www.hankcs.com/program/network/under-the-windows-compiler-webrtc.html
⑴ 下载git
⑵ 下载svn
⑶ 下载python
⑷ 获取depot_tools
(git clone https://chromium.googlesource.com/chromium/tools/depot_tools)
⑸ 下载Visual Studio2013 Community或Profesional
⑹ 下载dxsdk
⑺ 下载winsdk(win64带kx的iso)
2. 获取源代码
⑴
设置java环境 set JAVA_HOME=<location of OpenJDK 7>(windows)
export JAVA_HOME=<locationof OpenJDK 7>
(linux)
⑵ 创建工作目录,进去并执行
fetch webrtc获取代码
⑶
进入src 创建本地branch
cd src
gitcheckout master
gitnew-branch your-branch-name
⑷
开始更新代码
git pull
gclient sync
其中gclient sync是获取依赖和build文件
3. 配置
⑴ 更改区域
⑵ 的
4. 编译源代码
⑴ 生成windows vs sln文件
Set GYP_GENERATORS=msvs
Set GYP_MSVS_VERSION=2013
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_DEFINES=target_arch=x64(需要吗?)
python webrtc/build/gyp_webrtc -Gmsvs_version=2013
⑵ 打开all.sln,可以看到更个项目,根据自己想编译的项目编译,最终在src\build\Debug
5. 注意
⑴ 出现LINK : fatal error LNK1320: /MAXILKSIZEvalue 0x7FFFFFFF must be between 0x01000000 and 0x7FF00000,把项目里面属性的linker commanline的MAXILKSIZE改为0x7FF00000的十进制
⑵ 出现error MSB3721: The command "call..\yasm\binaries\win\yasm.exe "-fwin32" "-D__x86__""-DWIN32" "-DMSVC" "-Iwin/""-DRGBX_FILLER_0XFF" "-DSTRICT_MEMORY_ACCESS""-Isimd/" "-o" "..\..\build\Debug\obj\gl。。。因为缺少\yasm\binaries\win\yasm.exe,把build/debug下的yasm.exe复制到目录下
⑶ X86
fatalerror LNK1104: cannot open file'F:\webrtc\webrtc\src\build\Debug\lib\system_wrappers_default.lib',把system_wrappers.lib复制改为system_wrappers_default.lib
(4) 安装Microsoft Windows SDK 7.1的时候出现了一下错误:
Microsoft Windows SDK for Windows 7 product has reported the following error: Please refer to Samples\Setup\HTML\ConfigDetails.htm document for further information.,VS2010SP1时还自动安装了 Microsoft Visual C++ 2010 x86 Redistributable - 10.0.30319 及更高版本,一定要先卸载比 Microsoft Visual C++ 2010 x86 Redistributable - 10.0.30319 更高的版本(不包括Microsoft Visual C++ 2010 x86 Redistributable - 10.0.30319 )。