libmm-glib: separate files for flags and enums types

This allows us to skip needing to include the non-existent
build_string_from_mask() or get_string() counterparts in the
documentation index.
This commit is contained in:
Aleksander Morgado
2023-04-27 12:19:18 +00:00
committed by Aleksander Morgado
parent fdf03f9b2c
commit bf2843ad77
20 changed files with 166 additions and 130 deletions

View File

@@ -24,6 +24,7 @@ gen_sources += custom_target(
command: [
python,
mm_mkenums,
'--enums-only',
'--fhead', '#include "mm-enums-types.h"\n',
'--template', files(templates_dir / enums_types + '.c.template'),
'@INPUT@'],
@@ -37,6 +38,7 @@ gen_headers += custom_target(
command: [
python,
mm_mkenums,
'--enums-only',
'--fhead', '#include <ModemManager.h>\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',
@@ -46,6 +48,40 @@ gen_headers += custom_target(
install_dir: mm_glib_pkgincludedir,
)
# Flag types
enums_types = 'mm-flags-types'
gen_sources += custom_target(
enums_types + '.c',
input: mm_enums_header,
output: enums_types + '.c',
command: [
python,
mm_mkenums,
'--flags-only',
'--fhead', '#include "mm-flags-types.h"\n',
'--template', files(templates_dir / enums_types + '.c.template'),
'@INPUT@'],
capture: true,
)
gen_headers += custom_target(
enums_types + '.h',
input: mm_enums_header,
output: enums_types + '.h',
command: [
python,
mm_mkenums,
'--flags-only',
'--fhead', '#include <ModemManager.h>\n#ifndef __MM_FLAGS_TYPES_H__\n#define __MM_FLAGS_TYPES_H__\n',
'--template', files(templates_dir / enums_types + '.h.template'),
'--ftail', '#endif /* __MM_FLAGS_TYPES_H__ */\n',
'@INPUT@'],
capture: true,
install: true,
install_dir: mm_glib_pkgincludedir,
)
# Error types & quarks
errors_types = 'mm-errors-types'

View File

@@ -98,6 +98,7 @@
/* generated */
#include <mm-errors-types.h>
#include <mm-enums-types.h>
#include <mm-flags-types.h>
#include <mm-gdbus-manager.h>
#include <mm-gdbus-modem.h>
#include <mm-gdbus-bearer.h>

View File

@@ -24,6 +24,7 @@
#include <string.h>
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-errors-types.h"
#include "mm-common-helpers.h"
#include "mm-3gpp-profile.h"

View File

@@ -25,6 +25,7 @@
#include "mm-errors-types.h"
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-common-helpers.h"
#include "mm-bearer-properties.h"

View File

@@ -26,6 +26,7 @@
#include "mm-errors-types.h"
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-common-helpers.h"
#include "mm-call-properties.h"

View File

@@ -29,6 +29,7 @@
#include "mm-cell-info-nr5g.h"
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-errors-types.h"
/**

View File

@@ -29,6 +29,7 @@
#include <ModemManager.h>
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-errors-types.h"
#include "mm-common-helpers.h"

View File

@@ -26,6 +26,7 @@
#include "mm-errors-types.h"
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-common-helpers.h"
#include "mm-kernel-event-properties.h"

View File

@@ -24,6 +24,7 @@
#include <glib.h>
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-errors-types.h"
#include "mm-common-helpers.h"
#include "mm-pco.h"

View File

@@ -23,6 +23,7 @@
#include <string.h>
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-errors-types.h"
#include "mm-common-helpers.h"
#include "mm-simple-status.h"

View File

@@ -26,6 +26,7 @@
#include "mm-errors-types.h"
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-common-helpers.h"
#include "mm-sms-properties.h"

View File

@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "mm-enums-types.h"
#include "mm-flags-types.h"
#include "mm-unlock-retries.h"
/**