当前位置:网站首页>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",
]
}

边栏推荐
- 5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
- 联想R7000显卡的拆卸与安装
- Without 50W bride price, my girlfriend was forcibly dragged away. What should I do
- Common methods of JS array
- Botu uses peek and poke for IO mapping
- Yolov5 input (II) | CSDN creative punch in
- Webapidom get page elements
- Shallow and first code
- Class loading mechanism (detailed explanation of the whole process)
- Redis 入門和數據類型講解
猜你喜欢

Celebrate the new year together

leetcode860. Lemonade change

联想R7000显卡的拆卸与安装

The consumption of Internet of things users is only 76 cents, and the price has become the biggest obstacle to the promotion of 5g industrial interconnection
![[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached](/img/95/833f5ec20207ee5d7e6cdfa7208c5e.jpg)
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached

Oracle SQL table data loss

XML Configuration File

leetcode435. Non overlapping interval

(subplots usage) Matplotlib how to draw multiple subgraphs (axis field)

Detailed explanation of yolov5 training own data set
随机推荐
5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
(完美解决)matplotlib图例(legend)如何自由设置其位置
Maximum continuous sub segment sum (dynamic programming, recursive, recursive)
最大连续子段和(动态规划,递归,递推)
Audio Focus Series: write a demo to understand audio focus and audiomananger
Introduction to redis and explanation of data types
Introduction to deep learning (II) -- univariate linear regression
Review the configuration of vscode to develop golang
Redis Introduction et explication des types de données
leetcode406. Rebuild the queue based on height
在PyCharm中配置使用Anaconda环境
Do you know UVs in modeling?
How to connect the network: Chapter 2 (Part 1): a life cycle of TCP connection | CSDN creation punch in
leetcode435. Non overlapping interval
Principles of BTC cryptography
大学校园IP网络广播-厂家基于校园局域网的大学校园IP广播方案设计指南
1111 online map (30 points)
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached
[research materials] annual report of China's pension market in 2021 - Download attached
Notes | numpy-10 Iterative array