webrtc在windows下的编译

1、vpn

  不详述

2、官方文档地址

https://webrtc.org/native-code/development/ //官方编译首页
https://webrtc.org/native-code/development/prerequisite-sw/   //webrtc的依赖工具(包)
http://dev.chromium.org/developers/how-tos/install-depot-tools //下载depot-tools

https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md  //chrome 在windows下的编译方案

3、下载depot-tools

  下载depot-tools之后解压,把解压目录设置到环境变量里面 (PATH)

4、安装vs2017

5、下载安装windows 10 sdk

      目前我使用的版本 sdk 版本号 最好为 10.0.17134 ,同时记得安装器debug tool, 设置路径为 : Control Panel → Programs → Programs and Features → Select the “Windows Software Development Kit” → Change → Change → Check “Debugging Tools For Windows” → Change. Or, you can download the standalone SDK installer and use it to install the Debugging Tools.

  并配置环境变量 WINDOWSSDKDIR 指向 SDK 安装目录

6、修改系统语言

  Control Panel → System and Security → System → Advanced system settings

7、修改环境变量用于生成vs工程文件

  set DEPOT_TOOLS_WIN_TOOLCHAIN=0 

  set GYP_GENERATORS=ninja,msvs-ninja

  set GYP_MSVS_VERSION=2017

8、下载源码

mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc
gclient sync

9、生成解决方案

默认方案

gn gen --ide=vs out/Debug

ffmpeg h264的方案

gn gen --ide=vs out/Debug --args="rtc_use_h264=true is_component_ffmpeg=true"

 

10、迁徙工程

如果想把编译好的工程迁徙到其他的电脑该怎么办?

把1-9的步骤在新的电脑上重新做一遍(除了步骤8)

 

11、我遇到的异常,vs没有安装在系统盘里面

  修改 webrtc-code\src\build\vs_toolchain.py

 编译(生成webrtc.lib)

ninja -C out/Release webrtc

posted @ 2018-08-23 11:20  无名状  阅读(2699)  评论(0编辑  收藏  举报