Files
external_libcamera/include/libcamera/gen-header.sh
Laurent Pinchart 90de3690c4 libcamera: Auto-generate libcamera.h
As shown by two missing includes, keeping the libcamera.h file in sync
when adding or removing headers is an error-prone manual process.
Automate it by generating the header automatically.

The libcamera.h header is also added to the libcamera dependency
libcamera_dep to ensure that the headers gets generated before any
source depending on it gets compiled.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-05-23 13:56:36 +03:00

28 lines
513 B
Bash
Executable File

#!/bin/sh
src_dir="$1"
dst_file="$2"
cat <<EOF > "$dst_file"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* This file is auto-generated, do not edit! */
/*
* Copyright (C) 2018-2019, Google Inc.
*
* libcamera.h - libcamera public API
*/
#ifndef __LIBCAMERA_LIBCAMERA_H__
#define __LIBCAMERA_LIBCAMERA_H__
EOF
for header in "$src_dir"/*.h ; do
header=$(basename "$header")
echo "#include <libcamera/$header>" >> "$dst_file"
done
cat <<EOF >> "$dst_file"
#endif /* __LIBCAMERA_LIBCAMERA_H__ */
EOF