From 1ea124c7a3de5cb1289ec6416f957f7da5f0c1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dylan=20A=C3=AFssi?= Date: Fri, 7 Feb 2025 13:50:35 +0000 Subject: libcamera: meson: Fix libyuv detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already fall back to a subproject to support the libyuv package when it can not be discovered through the usual dependency() mechanism. Unfortunately libyuv may be packaged without any corresponding pkg-config support as can be seen at [0], so further extend the dependency search by using an explicit cxx.find_library() call. [0] https://packages.debian.org/bookworm/amd64/libyuv-dev/filelist Signed-off-by: Dylan Aïssi Tested-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/meson.build | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/meson.build b/src/meson.build index 76198e95..8eb8f05b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -29,8 +29,18 @@ endif # libyuv, used by the Android adaptation layer and the virtual pipeline handler. # Fallback to a subproject if libyuv isn't found, as it's typically not provided -# by distributions. -libyuv_dep = dependency('libyuv', required : false) +# by distributions. Where libyuv is provided by a distribution, it may not +# always supply a pkg-config implementation, requiring cxx.find_library() to +# search for it. +if not get_option('force_fallback_for').contains('libyuv') + libyuv_dep = dependency('libyuv', required : false) + if not libyuv_dep.found() + libyuv_dep = cxx.find_library('yuv', has_headers : 'libyuv.h', + required : false) + endif +else + libyuv_dep = dependency('', required : false) +endif if (pipelines.contains('virtual') or get_option('android').allowed()) and \ not libyuv_dep.found() -- cgit v1.2.1