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

边栏推荐
- 1118 birds in forest (25 points)
- Overview of basic knowledge of C language
- Do you know UVs in modeling?
- 小学校园IP网络广播-基于校园局域网的小学IP数字广播系统设计
- Detailed explanation of yolov5 training own data set
- MySQL master-slave configuration
- [set theory] relation properties (transitivity | transitivity examples | transitivity related theorems)
- JS scope
- Shallow and first code
- [basic grammar] C language uses for loop to print Pentagram
猜你喜欢

Yolov5 model construction source code details | CSDN creation punch in

JS scope

Botu uses peek and poke for IO mapping
![[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)](/img/af/8dfa783c87363a9d75c52e7680d508.jpg)
[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)

Audio Focus Series: write a demo to understand audio focus and audiomananger

Actual combat 8051 drives 8-bit nixie tube

Promise

小学校园IP网络广播-基于校园局域网的小学IP数字广播系统设计

The programmer resigned and was sentenced to 10 months for deleting the code. JD came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
![[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
随机推荐
在PyCharm中配置使用Anaconda环境
Technical analysis of qianyuantong multi card aggregation router
Make your own dataset
How to connect the network: Chapter 1 CSDN creation punch in
Cross platform plug-in flutter for displaying local notifications_ local_ notifications
[backtrader source code analysis 4] use Python to rewrite the first function of backtrader: time2num, which improves the efficiency by 2.2 times
"Hands on deep learning" pytorch edition Chapter II exercise
Shallow and first code
Ueditor, FCKeditor, kindeditor editor vulnerability
Common interview questions of microservice
XML Configuration File
1106 lowest price in supply chain (25 points)
Appium 1.22. L'Inspecteur appium après la version X doit être installé séparément
[backtrader source code analysis 5] rewrite several time number conversion functions in utils with Python
1107 social clusters (30 points)
Yolov5 input (II) | CSDN creative punch in
【实战项目】自主web服务器
Gbase8s composite index (I)
[set theory] relationship properties (symmetry | symmetry examples | symmetry related theorems | antisymmetry | antisymmetry examples | antisymmetry theorems)
Bluebridge cup real topic 2020 palindrome date simulation construction provincial competition