From fc54c57625993349287841973af77c054d8236cd Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Mon, 11 Jul 2022 15:18:23 +0200 Subject: [PATCH] package/libcamera: add explicit dependency on libevent if libevent package to be built The cam application requires libevent. Since there's no Kconfig option for it, cam building ability is checked by meson build system by default. If libevent is present in the sysroot, cam is built. The issue is that there's no explicit dependency on libevent in libcamera package. This means that it is possible for libevent AND libcamera to be built, but have libcamera be built before libevent. Meaning that even if all requirements seem to be fulfilled, cam still won't be enabled in some cases. This fixes the possible race by expliciting the dependency to libevent if the libevent package is enabled. Otherwise, explicitly disable cam building as it's already known that it isn't going to build. Cc: Quentin Schulz Signed-off-by: Quentin Schulz Signed-off-by: Yann E. MORIN (cherry picked from commit 030baf89fc9467329907abe07c292567e2f05c0f) Signed-off-by: Peter Korsgaard --- package/libcamera/libcamera.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/libcamera/libcamera.mk b/package/libcamera/libcamera.mk index 6db81f1758..51c3cf7466 100644 --- a/package/libcamera/libcamera.mk +++ b/package/libcamera/libcamera.mk @@ -84,6 +84,13 @@ else LIBCAMERA_CONF_OPTS += -Dqcam=disabled endif +ifeq ($(BR2_PACKAGE_LIBEVENT),y) +LIBCAMERA_CONF_OPTS += -Dcam=enabled +LIBCAMERA_DEPENDENCIES += libevent +else +LIBCAMERA_CONF_OPTS += -Dcam=disabled +endif + ifeq ($(BR2_PACKAGE_TIFF),y) LIBCAMERA_DEPENDENCIES += tiff endif