From efcfce02a95fe43adb40c1e01e82e0719a217983 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 27 Apr 2023 11:23:22 +0000 Subject: build-aux,mkenums: import custom mkenums tool from libqmi/libmbim We're going to use certain new features included in the custom tool. --- libmm-glib/generated/meson.build | 80 +++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 25 deletions(-) (limited to 'libmm-glib/generated') diff --git a/libmm-glib/generated/meson.build b/libmm-glib/generated/meson.build index 218afa4a..268c4fb1 100644 --- a/libmm-glib/generated/meson.build +++ b/libmm-glib/generated/meson.build @@ -17,50 +17,80 @@ gen_docs = [] # Enum types enums_types = 'mm-enums-types' -gen_sources += gnome.mkenums( +gen_sources += custom_target( enums_types + '.c', - sources: mm_enums_header, - c_template: build_aux_dir / enums_types + '.c.template', - fhead: '#include "mm-enums-types.h"\n', + input: mm_enums_header, + output: enums_types + '.c', + command: [ + python, + mm_mkenums, + '--fhead', '#include "mm-enums-types.h"\n', + '--template', files(templates_dir / enums_types + '.c.template'), + '@INPUT@'], + capture: true, ) -gen_headers += gnome.mkenums( +gen_headers += custom_target( enums_types + '.h', - sources: mm_enums_header, - h_template: build_aux_dir / enums_types + '.h.template', - fhead: '#include \n#ifndef __MM_ENUMS_TYPES_H__\n#define __MM_ENUMS_TYPES_H__\n', - ftail: '#endif /* __MM_ENUMS_TYPES_H__ */\n', - install_header: true, + input: mm_enums_header, + output: enums_types + '.h', + command: [ + python, + mm_mkenums, + '--fhead', '#include \n#ifndef __MM_ENUMS_TYPES_H__\n#define __MM_ENUMS_TYPES_H__\n', + '--template', files(templates_dir / enums_types + '.h.template'), + '--ftail', '#endif /* __MM_ENUMS_TYPES_H__ */\n', + '@INPUT@'], + capture: true, + install: true, install_dir: mm_glib_pkgincludedir, ) # Error types & quarks errors_types = 'mm-errors-types' -gen_sources += gnome.mkenums( - enums_types + '.c', - sources: mm_errors_header, - c_template: build_aux_dir / errors_types + '.c.template', - fhead: '#include \n#include "mm-errors-types.h"\n', +gen_sources += custom_target( + errors_types + '.c', + input: mm_errors_header, + output: errors_types + '.c', + command: [ + python, + mm_mkenums, + '--fhead', '#include \n#include "mm-errors-types.h"\n', + '--template', files(templates_dir / errors_types + '.c.template'), + '@INPUT@'], + capture: true, ) -gen_headers += gnome.mkenums( +gen_headers += custom_target( errors_types + '.h', - sources: mm_errors_header, - h_template: build_aux_dir / errors_types + '.h.template', - fhead: '#ifndef __MM_ERRORS_TYPES_H__\n#define __MM_ERRORS_TYPES_H__\n', - ftail: '#endif /* __MM_ERRORS_TYPES_H__ */\n', - install_header: true, + input: mm_errors_header, + output: errors_types + '.h', + command: [ + python, + mm_mkenums, + '--fhead', '#ifndef __MM_ERRORS_TYPES_H__\n#define __MM_ERRORS_TYPES_H__\n', + '--template', files(templates_dir / errors_types + '.h.template'), + '--ftail', '#endif /* __MM_ERRORS_TYPES_H__ */\n', + '@INPUT@'], + capture: true, + install: true, install_dir: mm_glib_pkgincludedir, ) errors_quarks = 'mm-errors-quarks' -gen_sources += gnome.mkenums( +gen_sources += custom_target( errors_quarks + '.c', - sources: mm_errors_header, - c_template: build_aux_dir / errors_quarks + '.c.template', - fhead: '#include \n#include "mm-errors-types.h"\n', + input: mm_errors_header, + output: errors_quarks + '.c', + command: [ + python, + mm_mkenums, + '--fhead', '#include \n#include "mm-errors-types.h"\n', + '--template', files(templates_dir / errors_quarks + '.c.template'), + '@INPUT@'], + capture: true, ) gdbus_ifaces = { -- cgit v1.2.3-70-g09d2