当前位置:网站首页>Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
2022-07-03 05:12:00 【Jiangnan - crossing the river with a reed】
Welcome to the bitter WebRTC download 、 Compile the world .
depot_tools
depot_tools It's a toolkit (depot Warehouse means ), It contains gclient、gcl、gn and ninja Tools such as , These tools are all used python Written . Its main function is to git The enhancement of , Make code management and compilation easier , The premise of learning this is to be able to use git.
obtain DEPOT TOOLS
LINUX / MAC System :
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=/path/to/depot_tools:$PATH
WINDOWS System :
https://storage.googleapis.com/chrome-infra/depot_tools.zip
Add to system environment variable , for example :
C:\depot_tools
After decompression , stay cmd In the implementation of gclient command , Download some windows Specific software and libraries . Such as git And python
If appear fail, It's going to continue gclient
depot_tools function gclient The tool will be updated automatically . To disable automatic updates , Please set environment variable DEPOT_TOOLS_UPDATE=0
To configure git
Omit , If you haven't used it git, Then you don't deserve to play WebRTC
visit Google
Do this by yourself !
Visual Studio 2019 as well as Windowns 10 SDK
Personal Edition Community version is ok , Install everything you can
Configure environment variables
Permanent variables – Set to the system environment variable :
DEPOT_TOOLS_WIN_TOOLCHAIN=0
GYP_MSVS_VERSION=2019
WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10\
GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
Temporary variable – Every time you execute
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2019
set WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10\
set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
tell depot_tools Use our native VS Compile
Download the source code
Find a disk with large space , Catalog
mkdir webrtc-m96
cd webrtc-m96
fetch --nohooks webrtc
gclient sync
Then there is the long wait , There are many things to be done .
If it is interrupted due to network and other reasons , Don't panic. :
We'll do it again
gclient sync
If it gets stuck , Don't panic. :
ctrl+c
gclient sync.
After downloading successfully , Switch branches m96
git checkout branch-heads/4664
gclient sync -D
Generate sln Solution
cd src
gn gen --ide=vs out\Default
Compile code
A command line compilation :
ninja -C out/Default
ninja
A kind of vs2019 compile :
Omit
There will be some mistakes , Some project generation compilation failed , But it doesn't matter ,example It can be used normally .
Common mistakes
Exception: No supported Visual Studio can be found. Supported versions are: 16.0 (2019), 15.0 (2017).
ERROR at //build/config/win/visual_studio_version.gni:27:7: Script returned non-zero exit code.
exec_script("…/…/vs_toolchain.py", [ “get_toolchain_dir” ], “scope”)
This is because python Script is looking for vs There is an error in the installation path of , The default is C Disk to find , But if vs2019 Not installed in C disc , That would have to be revised vs_toolchain.py This file , route src/build, The original code is as follows , Probably 176 That's ok :
path = os.path.expandvars('D:/Program Files (x86)/Microsoft Visual Studio/%s' % version)
os.path.expandvars('D:\Program Files (x86)\Microsoft Visual Studio/%s/Community' %version_as_year),
gn Ninja Introduce
Ninja It's the excuse Google Chrome A construction tool born out of the project , It was born for speed .
gn It solves the problem of cross platform compilation , But the code editing of each platform , It doesn't belong to the bottom C++ Scope of cross platform construction tools ( Whole frame C++ Process Qt exception ). One way is to , adopt gn Generate projects for each platform (xcode engineering 、vs engineering ) Then code , The modification of source files and engineering modules needs to be synchronized to gn In engineering documents ; Another way is to use vscode.
gn Documentation :
executable("hello") {
sources = [ "hello.cc" ]
deps = [
":hello_shared",
":hello_static",
]
}
shared_library("hello_shared") {
sources = [
"hello_shared.cc",
"hello_shared.h",
]
defines = [ "HELLO_SHARED_IMPLEMENTATION" ]
}
static_library("hello_static") {
sources = [
"hello_static.cc",
"hello_static.h",
]
}

边栏推荐
- Botu uses peek and poke for IO mapping
- appium1.22.x 版本后的 appium inspector 需单独安装
- Common interview questions of microservice
- [practical project] autonomous web server
- Coordinatorlayout appbarrayout recyclerview item exposure buried point misalignment analysis
- Without 50W bride price, my girlfriend was forcibly dragged away. What should I do
- Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)
- Do you know UVs in modeling?
- 50 practical applications of R language (36) - data visualization from basic to advanced
- 大学校园IP网络广播-厂家基于校园局域网的大学校园IP广播方案设计指南
猜你喜欢

Without 50W bride price, my girlfriend was forcibly dragged away. What should I do

Class loading mechanism (detailed explanation of the whole process)
![[batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)](/img/ce/d6f4fb30727e7436b6443537429ad4.png)
[batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)

Shallow and first code

Yolov5 model construction source code details | CSDN creation punch in

Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)

【实战项目】自主web服务器
![[practical project] autonomous web server](/img/99/892e600b7203c63bad02adb683c8f2.png)
[practical project] autonomous web server

Silent authorization login and registration of wechat applet

谷歌 | 蛋白序列的深度嵌入和比对
随机推荐
leetcode435. Non overlapping interval
[set theory] relation properties (reflexivity | reflexivity theorem | reflexivity | reflexivity theorem | example)
编译GCC遇到的“pthread.h” not found问题
Oracle SQL table data loss
[backtrader source code analysis 5] rewrite several time number conversion functions in utils with Python
leetcode452. Detonate the balloon with the minimum number of arrows
JS scope
Promise
JS string and array methods
Common interview questions of microservice
Cross platform plug-in flutter for displaying local notifications_ local_ notifications
Congratulations to musk and NADELLA on their election as academicians of the American Academy of engineering, and Zhang Hongjiang and Fang daining on their election as foreign academicians
Principles of BTC cryptography
Covering Safari and edge, almost all mainstream browsers have realized webgl 2.0 support
酒店公共广播背景音乐-基于互联网+的酒店IP网络广播系统设计
Review the configuration of vscode to develop golang
Kept hot standby and haproxy
Differences among bio, NiO and AIO
1119 pre- and post order traversals (30 points)
Go language interface learning notes