From 7c759ba8b0ba6ae7125d1baad1f9b9f096615b61 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 May 2023 13:49:38 +0200 Subject: [PATCH] lib/ffmpeg/meson.build: move libavutil helpers into separate library --- src/lib/ffmpeg/meson.build | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/lib/ffmpeg/meson.build b/src/lib/ffmpeg/meson.build index d570beb42..3e62881c0 100644 --- a/src/lib/ffmpeg/meson.build +++ b/src/lib/ffmpeg/meson.build @@ -13,6 +13,29 @@ else endif conf.set('HAVE_LIBAVFILTER', libavfilter_dep.found()) +if not libavutil_dep.found() + ffmpeg_util_dep = dependency('', required: false) + ffmpeg_dep = dependency('', required: false) + subdir_done() +endif + +ffmpeg_util = static_library( + 'ffmpeg_util', + 'Interleave.cxx', + 'Error.cxx', + include_directories: inc, + dependencies: [ + libavutil_dep, + ], +) + +ffmpeg_util_dep = declare_dependency( + link_with: ffmpeg_util, + dependencies: [ + libavutil_dep, + ], +) + if not enable_ffmpeg ffmpeg_dep = dependency('', required: false) subdir_done() @@ -36,10 +59,10 @@ ffmpeg = static_library( ffmpeg_sources, include_directories: inc, dependencies: [ + ffmpeg_util_dep, libavformat_dep, libavcodec_dep, libavfilter_dep, - libavutil_dep, log_dep, ], ) @@ -47,9 +70,9 @@ ffmpeg = static_library( ffmpeg_dep = declare_dependency( link_with: ffmpeg, dependencies: [ + ffmpeg_util_dep, libavformat_dep, libavcodec_dep, libavfilter_dep, - libavutil_dep, ], )