From 48f9660acd51dda1f4dbe778b5b5f9bec0483b34 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 9 Aug 2024 03:29:48 +0300 Subject: utils: codegen: gen-header.sh: Generate libcamera.h based on meson.build The libcamera.h header is a top-level library header that contains every other libcamera header. It is currently generated by listing the files in include/libcamera/ and dropping the .in suffix from template files. This assumes a 1:1 mapping between generated header file names and the name of their templates. Drop that assumption and base the libcamera.h generation on the libcamera public headers listed in meson.build. This makes the libcamera.h header generation more future-proof. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Scally Reviewed-by: Paul Elder --- include/libcamera/meson.build | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 36de1c2a..87b9a941 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -107,16 +107,6 @@ formats_h = custom_target('formats_h', install_dir : libcamera_headers_install_dir) libcamera_public_headers += formats_h -# libcamera.h -libcamera_h = custom_target('gen-header', - input : 'meson.build', - output : 'libcamera.h', - command : [gen_header, meson.current_source_dir(), '@OUTPUT@'], - install : true, - install_dir : libcamera_headers_install_dir) - -libcamera_public_headers += libcamera_h - # version.h version = libcamera_version.split('.') libcamera_version_config = configuration_data() @@ -129,3 +119,13 @@ version_h = configure_file(input : 'version.h.in', configuration : libcamera_version_config, install_dir : libcamera_headers_install_dir) libcamera_public_headers += version_h + +# libcamera.h +libcamera_h = custom_target('gen-header', + input : 'meson.build', + output : 'libcamera.h', + command : [gen_header, '@OUTPUT@', libcamera_public_headers], + install : true, + install_dir : libcamera_headers_install_dir) + +libcamera_public_headers += libcamera_h -- cgit v1.2.1