diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-05-30 17:38:43 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-05-30 18:29:08 +0300 |
commit | b9ecd85ed1fee2e9d715368b24592ad3009131d8 (patch) | |
tree | 00de5842513700a14291e7570905780c4c14709d /src/android/mm/meson.build | |
parent | 1450e09a0839d6ffa90abeede0bb1c959167eaab (diff) |
android: mm: Stub libhardware for build tests
Commit 66c618f378aa ("android: mm: generic: use
GRALLOC_HARDWARE_MODULE_ID") made libhardware a required dependency for
the Android camera HAL on non-Chrome OS platforms. This isn't an issue
for real devices, as Android provides libhardware, but it prevents
compile-testing the camera HAL on traditional Linux systems.
To restore the compile-test coverage, stub the libhardware function used
by the camera HAL when libhardware isn't found.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # meson build test
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/android/mm/meson.build')
-rw-r--r-- | src/android/mm/meson.build | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/android/mm/meson.build b/src/android/mm/meson.build index 85f12f91..e3e0484c 100644 --- a/src/android/mm/meson.build +++ b/src/android/mm/meson.build @@ -4,10 +4,14 @@ platform = get_option('android_platform') if platform == 'generic' android_hal_sources += files(['generic_camera_buffer.cpp', 'generic_frame_buffer_allocator.cpp']) - android_deps += [ - libdl, - dependency('libhardware'), - ] + android_deps += [libdl] + + libhardware = dependency('libhardware', required : false) + if libhardware.found() + android_deps += [libhardware] + else + android_hal_sources += files(['libhardware_stub.c']) + endif elif platform == 'cros' android_hal_sources += files(['cros_camera_buffer.cpp', 'cros_frame_buffer_allocator.cpp']) |