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

边栏推荐
- The process of browser accessing the website
- Introduction to rust Foundation (basic type)
- Detailed explanation of the output end (head) of yolov5 | CSDN creation punch in
- Notes | numpy-08 Advanced index
- Yolov5 input (I) -- mosaic data enhancement | CSDN creative punch in
- 1103 integer factorization (30 points)
- [set theory] relation properties (reflexivity | reflexivity theorem | reflexivity | reflexivity theorem | example)
- Messy change of mouse style in win system
- Interface frequency limit access
- BTC-密码学原理
猜你喜欢

Automatic voltage rise and fall 5-40v multi string super capacitor charging chip and solution

leetcode406. Rebuild the queue based on height

Yolov5 model construction source code details | CSDN creation punch in

Shallow and first code

Make your own dataset

JQ style, element operation, effect, filtering method and transformation, event object

Unity tool Luban learning notes 1

Overview of basic knowledge of C language

Principles of BTC cryptography

谷歌 | 蛋白序列的深度嵌入和比对
随机推荐
5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
[backtrader source code analysis 5] rewrite several time number conversion functions in utils with Python
[backtrader source code analysis 4] use Python to rewrite the first function of backtrader: time2num, which improves the efficiency by 2.2 times
Silent authorization login and registration of wechat applet
Unity tool Luban learning notes 1
Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)
1119 pre- and post order traversals (30 points)
(完美解决)matplotlib图例(legend)如何自由设置其位置
Appium 1.22. L'Inspecteur appium après la version X doit être installé séparément
The IntelliJ platform completely disables the log4j component
[research materials] annual report of China's pension market in 2021 - Download attached
Notes | numpy-08 Advanced index
[set theory] relational power operation (relational power operation | examples of relational power operation | properties of relational power operation)
JQ style, element operation, effect, filtering method and transformation, event object
How to connect the network: Chapter 1 CSDN creation punch in
Online VR model display - 3D visual display solution
Handler understands the record
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached
Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
appium1.22.x 版本后的 appium inspector 需单独安装