libyuv编译(各平台)

这篇博客详细记录了如何在多个操作系统上编译谷歌的libyuv库,包括Android、Windows、OSX、iOS和Linux等平台,涵盖了从安装预置条件、获取源码到使用不同工具链进行编译的全过程。
摘要由CSDN通过智能技术生成

最近用到视频格式转码,发现谷歌的开源库 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

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值