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 --- utils/codegen/gen-header.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'utils') diff --git a/utils/codegen/gen-header.sh b/utils/codegen/gen-header.sh index d4692758..c78f0859 100755 --- a/utils/codegen/gen-header.sh +++ b/utils/codegen/gen-header.sh @@ -1,7 +1,7 @@ #!/bin/sh -src_dir="$1" -dst_file="$2" +dst_file="$1" +shift cat < "$dst_file" /* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ -16,9 +16,8 @@ cat < "$dst_file" EOF -headers=$(for header in "$src_dir"/*.h "$src_dir"/*.h.in ; do +headers=$(for header in "$@" ; do header=$(basename "$header") - header="${header%.in}" echo "$header" done | sort) -- cgit v1.2.1