From patchwork Fri Jan 30 11:11:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26055 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 E8081C3226 for ; Fri, 30 Jan 2026 11:11:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0C27A61FC6; Fri, 30 Jan 2026 12:11:39 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jN3RLc+9"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 28FCD61F84 for ; Fri, 30 Jan 2026 12:11:37 +0100 (CET) Received: from pb-laptop.local (185.221.142.123.nat.pool.zt.hu [185.221.142.123]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 57B2173B for ; Fri, 30 Jan 2026 12:10:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769771458; bh=03R53uyysAS3PePBOFVGKZZFuRlZ5QQL+cV3fvUw/AI=; h=From:To:Subject:Date:From; b=jN3RLc+9e4q8NWJucbk0AtkO+CjaRd3XSY7Znp3VSTZi1JSOIRw+tzKncpjaOu0MJ uKngbLmdM/kKO0FBdPw9bFk288QHLwrM1GtDcy1fYveRbKlrQaBpUwjFofrbnPzZp6 sWIBz3Eh896PLmB0Y2XK0w7TKYmn1ZVgzGrYiEag= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] meson: Add options to control drm, sdl2, jpeg dependencies of `cam` Date: Fri, 30 Jan 2026 12:11:33 +0100 Message-ID: <20260130111133.1576210-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 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" Previously it was not possible to control these dependencies, they were always used if found. Furthermore, libjpeg was unnecessarily added as a dependency even if sdl2 was not found. Fix that by introducing three options to control the dependencies. Signed-off-by: Barnabás Pőcze Reviewed-by: Milan Zamazal --- meson_options.txt | 15 +++++++++++++++ src/apps/cam/meson.build | 36 ++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 8121cf5d2..58cf52ad1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -16,6 +16,21 @@ option('cam', value : 'auto', description : 'Compile the cam test application') +option('cam-output-kms', + type : 'feature', + value : 'auto', + description : 'Enable KMS output in the cam application') + +option('cam-output-sdl2', + type : 'feature', + value : 'auto', + description : 'Enable SDL2 output in the cam application') + +option('cam-output-sdl2-jpeg', + type : 'feature', + value : 'auto', + description : 'Enable JPEG support in the SDL2 output in the cam application') + option('documentation', type : 'feature', value : 'auto', diff --git a/src/apps/cam/meson.build b/src/apps/cam/meson.build index cd7f120f9..c73c0f5d9 100644 --- a/src/apps/cam/meson.build +++ b/src/apps/cam/meson.build @@ -17,9 +17,18 @@ cam_sources = files([ cam_cpp_args = [apps_cpp_args] -libdrm = dependency('libdrm', required : false) -libjpeg = dependency('libjpeg', required : false) -libsdl2 = dependency('SDL2', required : false) +cam_deps = [ + libatomic, + libcamera_public, + libevent, + libthreads, + libyaml, + libtiff, +] + +libdrm = dependency('libdrm', required : get_option('cam-output-kms')) +libsdl2 = dependency('SDL2', required : get_option('cam-output-sdl2')) +libjpeg = dependency('libjpeg', required : get_option('cam-output-sdl2-jpeg')) if libdrm.found() cam_cpp_args += [ '-DHAVE_KMS' ] @@ -27,6 +36,9 @@ if libdrm.found() 'drm.cpp', 'kms_sink.cpp' ]) + cam_deps += [ + libdrm, + ] endif if libsdl2.found() @@ -37,28 +49,24 @@ if libsdl2.found() 'sdl_texture_1plane.cpp', 'sdl_texture_yuv.cpp', ]) + cam_deps += [ + libsdl2, + ] if libjpeg.found() cam_cpp_args += ['-DHAVE_LIBJPEG'] cam_sources += files([ 'sdl_texture_mjpg.cpp' ]) + cam_deps += [ + libjpeg, + ] endif endif cam = executable('cam', cam_sources, link_with : apps_lib, - dependencies : [ - libatomic, - libcamera_public, - libdrm, - libevent, - libjpeg, - libsdl2, - libtiff, - libthreads, - libyaml, - ], + dependencies : cam_deps, cpp_args : cam_cpp_args, install : true, install_tag : 'bin')