meson setup --prefix /usr/gstreamer --libdir lib --buildtype release --strip -Dgpl=enabled -Drs=enabled -Dgst-examples=disabled -Dtests=disabled -Dexamples=disabled -Dlibnice=enabled -Dwebrtc=enabled -Dlibav=enabled -Drtsp_server=enabled -Dvaapi=enabled -Dgst-plugins-bad:opencv=enabled -Dgst-plugins-bad:srt=enabled -Dgst-plugins-base:theora=enabled -Dglib:tests=false -Djson-glib:tests=false -Dorc:benchmarks=disabled -Dgst-plugins-good:adaptivedemux2=disabled -Dopus:tests=disabled builddir
更新 configure options
meson configure -Doption=new_value builddir
# 仅 reconfigure
meson setup --reconfigure builddir
# 或者 清除依赖缓存,重新查找依赖
meson setup --reconfigure --clearcache builddir
开始编译
meson compile -C builddir
安装
meson install --quiet -C builddir
安装路径由 setup
时的 options 指定
安装更新
meson install --only-changed --quiet -C builddir
查看项目信息 https://mesonbuild.com/Commands.html#introspect
若在编译 gstreamer-rs
系列插件包时,出现内存不足,out of memory
错误,编译进程被系统杀掉的情况,可以使用 rust 编译链的编译选项控制并行作业数。
ninja
的 -j
, -l
编译选项在此毫无作用。
https://doc.rust-lang.org/cargo/reference/config.html#buildjobs
直接使用环境变量 CARGO_BUILD_JOBS
NOTE: Meson will not update subprojects automatically once a subproject has been fetched. Remember to update subprojects if wrap files are updated.
meson subprojects update
如果命令执行失败,可以手动删除 subprojects/
下的指定项目文件夹,然后手动下载项目
meson subprojects download <subproject-name>