最近用到视频格式转码,发现谷歌的开源库 libyuv 很好用,所以记录下编译过程
直接贴 官网的编译流程
https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/getting_started.md
不过我得吐槽一下,我特么就想编译个libyuv 你特么非要让我把chrome项目check 下来是几个意思。。。。如果没猜错 应该是好几个g
Getting Started
How to get and build the libyuv code.
Pre-requisites
You'll need to have depot tools installed: https://www.chromium.org/developers/how-tos/install-depot-tools Refer to chromium instructions for each platform for other prerequisites.
说明:依赖工具,谷歌的这套东西还是比较好用的,首先要安装depottools 这点不多说,命令行就行,最重要的是在下载完成之后要有
export PATH=`pwd`/depot_tools:"$PATH" 命令使能这个工具
Getting the Code
Create a working directory, enter it, and run:
gclient config https://chromium.googlesource.com/libyuv/libyuv gclient sync
说明:设置与同步代码,里面自带脚本,关于代码如何同步的就无需关心了。
Then you'll get a .gclient file like:
solutions = [ { "name" : "libyuv", "url" : "https://chromium.googlesource.com/libyuv/libyuv", "deps_file" : "DEPS", "managed" : True, "custom_deps" : { }, "safesync_url": "", }, ];
For iOS add ;target_os=['ios'];
to your OSX .gclient and run GYP_DEFINES="OS=ios" gclient sync.
Browse the Git reprository: https://chromium.googlesource.com/libyuv/libyuv/+/master
Android
For Android add ;target_os=['android'];
to your Linux .gclient
solutions = [ { "name" : "libyuv", "url" : "https://chromium.googlesource.com/libyuv/libyuv", "deps_file" : "DEPS", "managed" : True, "custom_deps" : { }, "safesync_url": "", }, ]; target_os = ["android", "unix"];
Then run:
export GYP_DEFINES="OS=android" gclient sync
Caveat: Theres an error with Google Play services updates. If you get the error “Your version of the Google Play services library is not up to date”, run the following: cd chromium/src ./build/android/play_services/update.py download cd ../..
For Windows the gclient sync must be done from an Administrator command prompt.
The sync will generate native build files for your environment using gyp (Windows: Visual Studio, OSX: XCode, Linux: make). This generation can also be forced manually: gclient runhooks
To get just the source (not buildable): git clone https://chromium.googlesource.com/libyuv/libyuv
Building the Library and Unittests
Windows
set GYP_DEFINES=target_arch=ia32 call python gyp_libyuv -fninja -G msvs_version=2013 ninja -j7 -C out\Release ninja -j7 -C out\Debug set GYP_DEFINES=target_arch=x64 call python gyp_libyuv -fninja -G msvs_version=2013 ninja -C out\Debug_x64 ninja -C out\Release_x64
Building with clangcl
set GYP_DEFINES=clang=1 target_arch=ia32 libyuv_enable_svn=1 set LLVM_REPO_URL=svn://svn.chromium.org/llvm-project call python tools\clang\scripts\update.py call python gyp_libyuv -fninja libyuv_test.gyp ninja -C out\Debug ninja -C out\Release