----------------------------------------------------------------------------------------------------------------------

一分钟快速搭建 rtmpd 服务器: https://blog.csdn.net/freeabc/article/details/102880984

软件下载地址: http://www.qiyicc.com/download/rtmpd.zip

github 地址:https://github.com/superconvert/smart_rtmpd

----------------------------------------------------------------------------------------------------------------------

 今天说说构建工具 depot_tools

 

depot_tools 的依赖:

请首先保证你的机器上装有 git 和 python,其实 depot_tools 下很多命令其实就是 bash 文件,最终去执行对应的 python 文件。比如:

fetch     --->     fetch.py
gn        --->     gn.py
gclient   --->     gclient.py

代码下载时,又用到版本管理工具 git 或 svn 等 

 

depot_tools 的作用:

对于 chrome 以及 webrtc 的编译都离不开一个构建工具 depot_tools,因 chrome 和 webrtc 项目过于庞大,依赖比较多,因此需要一个构建工具对其进行管理,以方便后续的开发人员,利用此工具快速下载代码,构建编译环境,并能正确编译。

因此 depot_tools 的作用就是:

1. 下载,更新,同步代码

2. 构建编译环境,利用 gn 生成 ninja 文件

3. gn 生成的 ninjia 文件并通过工具 ninjia 进行最终编译成想要的目标

 

怎么下载 depot_tools :

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

我们把下载好的 depot_tools 下,配置对应的环境,其实就是把路径加到系统变量中(linux, Mac, Windows),这样我们就可以直接使用 fetch, gclient, gn, ninja 这些命令了 

 

 下载代码(webrtc 为例):

mkdir webrtc && cd webrtc
linux : fetch --nohooks webrtc
android: fetch --nohooks webrtc_android
ios: fetch --nohooks webrtc_ios
gclient sync

 很大程度上都是不成功的,因为我们有伟大的 GFW 。国内有

声网镜像 https://webrtc.org.cn/mirror

学而思镜像 https://gitlab.com/webrtc-mirror

 

fetch 是获取源码, glcient 基本上封装了 git 的一些功能,提供 git 多个仓库的批量操作。

 

编译源码(webrtc 的 android 版本为例):

安装依赖

cd src
export GYP_DEFINES="OS=android"
./build/install-build-deps.sh
./build/install-build-deps-android.sh

编译文件生成和编译

./build/android/envsetup.h
gn gen android/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"arm64\""
ninja -C android/Release

 我们定制底层的库后,就可以按上述步骤进行重新编译,使用了

 

常见错误及原因:

1. gn.py: Could not find checkout in any parent of the current path

这个一般都是 depot_tools 没有正确安装和初始化。

比如缺少 .gclient, .gclient_entries

2.  Could not find gn.exe

这个一般都是 depot_tools 没有正确安装和初始化。

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐