From b9ecd85ed1fee2e9d715368b24592ad3009131d8 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 30 May 2023 17:38:43 +0300 Subject: 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 Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek # meson build test Reviewed-by: Kieran Bingham --- src/android/mm/libhardware_stub.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/android/mm/libhardware_stub.c (limited to 'src/android/mm/libhardware_stub.c') diff --git a/src/android/mm/libhardware_stub.c b/src/android/mm/libhardware_stub.c new file mode 100644 index 00000000..00f15cd9 --- /dev/null +++ b/src/android/mm/libhardware_stub.c @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (C) 2023, Ideas on Board + * + * libhardware_stub.c - Android libhardware stub for test compilation + */ + +#include + +#include + +int hw_get_module(const char *id __attribute__((__unused__)), + const struct hw_module_t **module) +{ + *module = NULL; + return -ENOTSUP; +} -- cgit v1.2.1