Skip to content

Commit b7b45bb

Browse files
tintoujpakkane
authored andcommitted
modules/gnome: Allow to specify the doc-format argument
Add the support for the doc-format argument if g-ir-scanner supports it. Ignore the argument otherwise as this is a no-op in such cases.
1 parent f0795e1 commit b7b45bb

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

docs/markdown/Gnome-module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ There are several keyword arguments. Many of these map directly to the
9393
`g-ir-scanner` tool so see its documentation for more information.
9494

9595
* `dependencies`: deps to use during introspection scanning
96+
* `doc_format`: (*Added 1.8.0*) format of the inline documentation
9697
* `extra_args`: command line arguments to pass to gir compiler
9798
* `env`: (*Added 1.2.0*) environment variables to set, such as
9899
`{'NAME1': 'value1', 'NAME2': 'value2'}` or `['NAME1=value1', 'NAME2=value2']`,

mesonbuild/modules/gnome.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class GenerateGir(TypedDict):
8282

8383
build_by_default: bool
8484
dependencies: T.List[Dependency]
85+
doc_format: T.Optional[str]
8586
export_packages: T.List[str]
8687
extra_args: T.List[str]
8788
fatal_warnings: bool
@@ -1103,6 +1104,7 @@ def _get_scanner_ldflags(ldflags: T.Iterable[str]) -> T.Iterable[str]:
11031104
_EXTRA_ARGS_KW,
11041105
ENV_KW.evolve(since='1.2.0'),
11051106
KwargInfo('dependencies', ContainerTypeInfo(list, Dependency), default=[], listify=True),
1107+
KwargInfo('doc_format', (str, NoneType), since='1.8.0'),
11061108
KwargInfo('export_packages', ContainerTypeInfo(list, str), default=[], listify=True),
11071109
KwargInfo('fatal_warnings', bool, default=False, since='0.55.0'),
11081110
KwargInfo('header', ContainerTypeInfo(list, str), default=[], listify=True),
@@ -1208,6 +1210,9 @@ def generate_gir(self, state: 'ModuleState', args: T.Tuple[T.List[T.Union[Execut
12081210
scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_source_dir(), state.root_subdir)]
12091211
scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_build_dir(), state.root_subdir)]
12101212

1213+
if kwargs['doc_format'] is not None and self._gir_has_option('--doc-format'):
1214+
scan_command += ['--doc-format', kwargs['doc_format']]
1215+
12111216
if '--warn-error' in scan_command:
12121217
FeatureDeprecated.single_use('gnome.generate_gir argument --warn-error', '0.55.0',
12131218
state.subproject, 'Use "fatal_warnings" keyword argument', state.current_node)

test cases/frameworks/7 gnome/gir/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ gnome.generate_gir(
4747
includes : ['GObject-2.0', 'MesonDep1-1.0'],
4848
# dep1_dep pulls in dep2_dep for us
4949
dependencies : [[fake_dep, dep1_dep]],
50+
doc_format: 'gtk-doc-markdown',
5051
install : true,
5152
build_by_default : true,
5253
)

0 commit comments

Comments
 (0)