From patchwork Mon Nov 25 00:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 22066 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E41FABD808 for ; Mon, 25 Nov 2024 00:52:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D536066002; Mon, 25 Nov 2024 01:52:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="eBau7LXq"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 637B165FC6 for ; Mon, 25 Nov 2024 01:52:39 +0100 (CET) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D5A4E4AD; Mon, 25 Nov 2024 01:52:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1732495938; bh=sl7tulU8jmZMjYCZXuuDsQzZ+3s55g6eoN+SEzY44bI=; h=From:To:Cc:Subject:Date:From; b=eBau7LXqyCTw4X7Dh8aCv8eizStI2Ww9ebd9QPsi48KNS+RSOfXDLG6riOuO7Zwew 21Tnd51UbG7jtlJjBaQBRmSmz510fNB6RgopGvFECWCUuGI/RG1ZGLer9iGhxmiFJB a9lxniCl+bgbw7ChMKlKMXdhO2lCiDLULI5e/8UQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH] meson: Don't unnecessarily fallback to libyuv wrap Date: Mon, 25 Nov 2024 02:52:28 +0200 Message-ID: <20241125005228.24737-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Before commit eeaa7de21b8c ("libcamera: pipeline: Add test pattern for VirtualPipelineHandler") the libyuv dependency was only needed for the Android adaptation layer. As libyuv isn't packaged by most distribution, meson fell back to using a meson wrap if the Android adaptation layer was enabled and the library wasn't found. With commit eeaa7de21b8c, libyuv is also used by the virtual pipeline handler, and the meson wrap fallback handling got centralized and became unconditional, so the wrap is downloaded even if the components depending on libyuv are all disabled. This causes unnecessary downloads at setup time, which can be problematic on build systems without an internet connection. Fix this by making the wrap fallback conditional on the components that use libyuv. Fixes: eeaa7de21b8c ("libcamera: pipeline: Add test pattern for VirtualPipelineHandler") Signed-off-by: Laurent Pinchart Reviewed-by: Harvey Yang Reviewed-by: Kieran Bingham --- src/android/meson.build | 3 +-- src/meson.build | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) base-commit: 9a5f91c78abc8985baff89563992be3644f861b0 diff --git a/src/android/meson.build b/src/android/meson.build index 6341ee8b0bfb..7b226a4b5d35 100644 --- a/src/android/meson.build +++ b/src/android/meson.build @@ -4,6 +4,7 @@ android_deps = [ dependency('libexif', required : get_option('android')), dependency('libjpeg', required : get_option('android')), libcamera_private, + libyuv_dep, ] android_enabled = true @@ -15,8 +16,6 @@ foreach dep : android_deps endif endforeach -android_deps += [libyuv_dep] - android_hal_sources = files([ 'camera3_hal.cpp', 'camera_capabilities.cpp', diff --git a/src/meson.build b/src/meson.build index 91bea7753a2e..76198e9535db 100644 --- a/src/meson.build +++ b/src/meson.build @@ -27,11 +27,13 @@ else ipa_sign_module = false 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) -# Fallback to a subproject if libyuv isn't found, as it's typically not -# provided by distributions. -if not libyuv_dep.found() +if (pipelines.contains('virtual') or get_option('android').allowed()) and \ + not libyuv_dep.found() cmake = import('cmake') libyuv_vars = cmake.subproject_options()