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>
This commit is contained in:
parent
de20029a58
commit
d5ce2679c6
4 changed files with 18 additions and 11 deletions
|
@ -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',
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue