diff options
-rw-r--r-- | include/libcamera/ipa/core.mojom | 6 | ||||
-rw-r--r-- | include/libcamera/ipa/ipa_interface.h | 4 | ||||
-rw-r--r-- | utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl | 2 | ||||
-rw-r--r-- | utils/ipc/generators/mojom_libcamera_generator.py | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index 33b8abed..5cef340d 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -14,8 +14,8 @@ module libcamera; * - structs * * Attributes: - * - skipHeader - structs only, and only in core.mojom - * - Do not generate a C++ definition for the structure + * - skipHeader - allowed only for structs and enums in core.mojom + * - Do not generate a C++ definition for the structure or enum * - Any type used in a mojom interface definition must have a corresponding * definition in a mojom file for the code generator to accept it, except * for types solely used as map/array members for which a definition is not @@ -52,6 +52,8 @@ module libcamera; * then the type definition in the core.mojom file should have the * [skipHeader] attribute only * - A (de)serializer will be generated for the type + * - enums that are defined in a libcamera C++ header also fall in this + * category * - If a type definition has [skipHeader], then the header where the type is * defined must be included in ipa_interface.h * - Types that are solely used as array/map members do not require a mojom diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h index 8afcfe21..8884f0ed 100644 --- a/include/libcamera/ipa/ipa_interface.h +++ b/include/libcamera/ipa/ipa_interface.h @@ -23,8 +23,8 @@ namespace libcamera { /* - * Structs that are defined in core.mojom and have the skipHeader tag must be - * #included here. + * Structs and enums that are defined in core.mojom that have the skipHeader + * tag must be #included here. */ class IPAInterface diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl index a565b59a..c60b99b8 100644 --- a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl @@ -26,7 +26,7 @@ namespace libcamera { static const {{const.kind|name}} {{const.mojom_name}} = {{const.value}}; {% endfor %} -{% for enum in enums %} +{% for enum in enums_gen_header %} {{funcs.define_enum(enum)}} {% endfor %} diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/generators/mojom_libcamera_generator.py index 442f797c..1a629f9d 100644 --- a/utils/ipc/generators/mojom_libcamera_generator.py +++ b/utils/ipc/generators/mojom_libcamera_generator.py @@ -483,7 +483,7 @@ class Generator(generator.Generator): def _GetJinjaExportsForCore(self): return { 'consts': self.module.constants, - 'enums': self.module.enums, + 'enums_gen_header': [x for x in self.module.enums if x.attributes is None or 'skipHeader' not in x.attributes], 'has_array': len([x for x in self.module.kinds.keys() if x[0] == 'a']) > 0, 'has_map': len([x for x in self.module.kinds.keys() if x[0] == 'm']) > 0, 'structs_gen_header': [x for x in self.module.structs if x.attributes is None or 'skipHeader' not in x.attributes], |