summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-09-16 16:04:03 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-09-16 18:15:28 +0300
commitd5ce2679c67877295ce0096afd3d24d28ad34d16 (patch)
tree460048faef4fd8b869edfaf60845b554a42cf588 /src/android
parentde20029a582a71a87d99388a62fb63c86e85028a (diff)
libcamera: Turn the android option into a feature
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/meson.build19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/android/meson.build b/src/android/meson.build
index ecb92f6e..0293c203 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)