[libcamera-devel] [PATCH v3 7/7] libcamera: Declare dependency on generated headers

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Mar 7 22:13:26 CET 2020


From: Kieran Bingham <kieran.bingham at ideasonboard.com>

The control headers are generated automatically by parsing our YAML
descriptions, and creating the control headers.

These headers are included by internal libcamera source files, but the
build system isn't informed of this dependency. This allows a race
condition to occur in builds where objects are attempted to be built
before the included headers have been generated, resulting in a build
failure or, worse, in a successful but incorrect build.

Declare a dependency on the control headers for libcamera to ensure that
they are built before compiling any object within the libcamera library.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
[Split the change out and reworded commit message]
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/libcamera/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index ac6f597c6188..692ca5899f3a 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -97,6 +97,7 @@ libcamera_deps = [
     cc.find_library('dl'),
     libudev,
     dependency('threads'),
+    declare_dependency(sources : [control_headers])
 ]
 
 libcamera_link_with = []
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list