From patchwork Wed Sep 16 13:06:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9635 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 ADADBC3B5B for ; Wed, 16 Sep 2020 13:06:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1CC0962E9F; Wed, 16 Sep 2020 15:06:55 +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="v5ADE94R"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 17A2660533 for ; Wed, 16 Sep 2020 15:06:54 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 234D257F for ; Wed, 16 Sep 2020 15:06:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1600261606; bh=3vIy/5oF5YkidmRE+aya3qCJFEjFz1aXte8aq8HX2NI=; h=From:To:Subject:Date:From; b=v5ADE94RR6s8GKrjyjaDz9X94PDXEJVsRNhrNYh8EMl2W7kaJZTi+lpsWV4gup578 IQRhj5mLGx4bK/qmfYnUwAHzWFC/Bju9APy5jaQlxL9w4GAkmO52a+5oj+49nIXX14 qEu/VTuxqY1LV30/B14Ht2/VlNne0sVeNBcBZoRw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 16 Sep 2020 16:06:12 +0300 Message-Id: <20200916130612.27694-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: Turn the android option into a feature 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" Allow disabling compilation of the Android HAL adaptation layer automatically when a dependency is missing by turning the android option into a feature. The default value is set to 'disabled' to match the current behaviour. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- meson_options.txt | 4 ++-- src/android/meson.build | 19 ++++++++++++++----- src/libcamera/meson.build | 2 +- src/meson.build | 4 +--- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index e9e815fde366..d2e07ef1450f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,8 +1,8 @@ # SPDX-License-Identifier: CC0-1.0 option('android', - type : 'boolean', - value : false, + type : 'feature', + value : 'disabled', description : 'Compile libcamera with Android Camera3 HAL interface') option('documentation', diff --git a/src/android/meson.build b/src/android/meson.build index ecb92f6e9b3a..0293c2036561 100644 --- a/src/android/meson.build +++ b/src/android/meson.build @@ -1,5 +1,19 @@ # SPDX-License-Identifier: CC0-1.0 +android_deps = [ + dependency('libexif', required : get_option('android')), + dependency('libjpeg', required : get_option('android')), +] + +android_enabled = true + +foreach dep : android_deps + if not dep.found() + android_enabled = false + subdir_done() + endif +endforeach + android_hal_sources = files([ 'camera3_hal.cpp', 'camera_hal_manager.cpp', @@ -14,11 +28,6 @@ android_camera_metadata_sources = files([ 'metadata/camera_metadata.c', ]) -android_deps = [ - dependency('libexif'), - dependency('libjpeg'), -] - android_camera_metadata = static_library('camera_metadata', android_camera_metadata_sources, include_directories : android_includes) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index af2f3d950be6..0e6ecf5060a4 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -121,7 +121,7 @@ libcamera_deps = [ libcamera_link_with = [] -if get_option('android') +if android_enabled libcamera_sources += android_hal_sources includes += android_includes libcamera_link_with += android_camera_metadata diff --git a/src/meson.build b/src/meson.build index d69b4c1ea978..0c5b64d68c15 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,8 +1,6 @@ # SPDX-License-Identifier: CC0-1.0 -if get_option('android') - subdir('android') -endif +subdir('android') openssl = find_program('openssl', required : true) if openssl.found()