[libcamera-devel] [PATCH v2] libcamera: Declare dependency on generated headers
Kieran Bingham
kieran.bingham at ideasonboard.com
Fri Mar 6 18:20:30 CET 2020
The control headers are generated automatically by parsing our YAML
descriptions, and creating the control headers.
The headers for the controls can be used directly from within libcamera
internal pipeline handlers and core components, but there is no link to
ensure that the headers are generated before they are used.
As part of updating controls to support properties, the commit
f870591a9bf5 ("libcamera: properties: Add location property") also
inadvertently moved the generated headers out of the libcamera_api
dependency generation.
This allowed a race condition to occur in builds where objects are
attempted to be built before the API definitions had been generated.
Declare a dependency on the headers for libcamera to ensure that they
are built before compiling any object within the libcamera library, and
re-introduce the headers to the libcamera_api variable.
Fixes: f870591a9bf5 ("libcamera: properties: Add location property")
Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
include/libcamera/meson.build | 2 ++
src/libcamera/meson.build | 1 +
2 files changed, 3 insertions(+)
diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
index f47c583cbbc0..88edf620f69e 100644
--- a/include/libcamera/meson.build
+++ b/include/libcamera/meson.build
@@ -44,6 +44,8 @@ foreach header : control_source_files
install_dir : join_paths('include', include_dir))
endforeach
+libcamera_api += control_headers
+
gen_header = files('gen-header.sh')
libcamera_h = custom_target('gen-header',
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 88658ac563f7..cd95fa11534a 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 = []
--
2.20.1
More information about the libcamera-devel
mailing list