오늘은 빌드 도구 depot_tools에 대해 이야기합니다.

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

1 분 안에 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

실제로 시스템 변수 (linux, Mac, Windows)에 경로를 추가하는 다운로드 된 depot_tools 아래에 해당 환경을 구성하여 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
./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 : 현재 경로의 부모에서 체크 아웃을 찾을 수 없습니다.

이는 일반적으로 depot_tools가 올바르게 설치 및 초기화되지 않았기 때문입니다.

예 : .gclient, .gclient_entries 부족

2.   gn.exe를 찾을 수 없습니다.

이는 일반적으로 depot_tools가 올바르게 설치 및 초기화되지 않았기 때문입니다.

추천

출처blog.csdn.net/freeabc/article/details/109027732