当前位置:网站首页>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 principle is simple, but I don't know how to use it? Understand "contemporaneous group model" in one article
- The process of browser accessing the website
- Esp32-c3 learning and testing WiFi (II. Wi Fi distribution - smart_config mode and BlueIf mode)
- Wechat applet distance and map
- 乾元通多卡聚合路由器的技术解析
- Notes | numpy-07 Slice and index
- JS dynamic table creation
- Silent authorization login and registration of wechat applet
- Overview of basic knowledge of C language
- Gbase8s composite index (I)
猜你喜欢
Overview of basic knowledge of C language
[research materials] the fourth quarter report of the survey of Chinese small and micro entrepreneurs in 2021 - Download attached
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
JS scope
Appium 1.22. L'Inspecteur appium après la version X doit être installé séparément
How to connect the network: Chapter 2 (Part 1): a life cycle of TCP connection | CSDN creation punch in
Interface frequency limit access
[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)
Automatic voltage rise and fall 5-40v multi string super capacitor charging chip and solution
Basic use of Metasploit penetration testing framework
随机推荐
在PyCharm中配置使用Anaconda环境
Three representations of signed numbers: original code, inverse code and complement code
Overview of basic knowledge of C language
1114 family property (25 points)
Force GCC to compile 32-bit programs on 64 bit platform
Without 50W bride price, my girlfriend was forcibly dragged away. What should I do
1111 online map (30 points)
Covering Safari and edge, almost all mainstream browsers have realized webgl 2.0 support
Webapidom get page elements
C language program ideas and several commonly used filters
Automatic voltage rise and fall 5-40v multi string super capacitor charging chip and solution
Redis 击穿穿透雪崩
appium1.22. Appium inspector after X version needs to be installed separately
Rust基础入门之(基本类型)
Yolov5 input (II) | CSDN creative punch in
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
Detailed explanation of the output end (head) of yolov5 | CSDN creation punch in
Gbase8s composite index (I)
Gbase8s unique index and non unique index
Yolov5 model construction source code details | CSDN creation punch in