From patchwork Thu Sep 24 10:02:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 9786 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 D0503C3B5B for ; Thu, 24 Sep 2020 10:02:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6023C62FDA; Thu, 24 Sep 2020 12:02:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DSlgRgrb"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B8F4A60363 for ; Thu, 24 Sep 2020 12:02:05 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 45C612FD; Thu, 24 Sep 2020 12:02:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1600941725; bh=1SUOL2WDm9p2n2YsG+jKWNLd4tjBULuxJuhEDmTsENY=; h=From:To:Cc:Subject:Date:From; b=DSlgRgrbpO1hZMqtE6swNyzt8g3Q5tRK6M6B7WdlhrCdyxdDtDBk/vH1qw/Epa5GE Ybyeex3YplhJZMziV2o5R2Z+h/39qhRQkr/YxunZtWStvy/kswoq31FUY3Zr0IK26+ RtAFuh+fB7QOKoPP/Xy6Z4vAFku/x2XTwqnjmtCU= From: Kieran Bingham To: libcamera devel Date: Thu, 24 Sep 2020 11:02:01 +0100 Message-Id: <20200924100201.353624-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH] ipa: rpi: Make boost optional 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" By default the Raspberry Pi pipeline handler is enabled when configuring the build. The Raspberry Pi IPA currently depends upon 'boost' which is a large dependency to bring in. Make the IPA compilation dependant upon the availabilty of the boost library, but display a warning when the pipeline is enabled and the dependency is not found. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- This is mostly posted to promote discussion on this topic. The requirement for boost is really heavy (+100MB package for a few headers), and is only used for the RPi IPA. This patch automatically disables the IPA while printing a message if it was selected if the boost library is not available. Doing all of this in a clean way seems quite difficult because of the way the meson options works ... so ... 3 ... 2 ... 1 .... Discuss... src/ipa/raspberrypi/meson.build | 40 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build index 9445cd097df5..b284378c9621 100644 --- a/src/ipa/raspberrypi/meson.build +++ b/src/ipa/raspberrypi/meson.build @@ -2,9 +2,11 @@ ipa_name = 'ipa_rpi' +boost = dependency('boost', required : false) + rpi_ipa_deps = [ libcamera_dep, - dependency('boost'), + boost, libatomic, ] @@ -41,22 +43,26 @@ rpi_ipa_sources = files([ 'controller/pwl.cpp', ]) -mod = shared_module(ipa_name, - rpi_ipa_sources, - name_prefix : '', - include_directories : rpi_ipa_includes, - dependencies : rpi_ipa_deps, - link_with : libipa, - install : true, - install_dir : ipa_install_dir) - -if ipa_sign_module - custom_target(ipa_name + '.so.sign', - input : mod, - output : ipa_name + '.so.sign', - command : [ ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@' ], - install : false, - build_by_default : true) +if boost.found() + mod = shared_module(ipa_name, + rpi_ipa_sources, + name_prefix : '', + include_directories : rpi_ipa_includes, + dependencies : rpi_ipa_deps, + link_with : libipa, + install : true, + install_dir : ipa_install_dir) + + if ipa_sign_module + custom_target(ipa_name + '.so.sign', + input : mod, + output : ipa_name + '.so.sign', + command : [ ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@' ], + install : false, + build_by_default : true) + endif +else + warning('The Raspberry Pi pipeline is enabled, but dependency "boost" was not found') endif subdir('data')