From eb7ed4dafbcd82a88a106ef088e126373ee11738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Sun, 16 Sep 2018 21:28:37 +0200 Subject: [PATCH] gnome.gtkdoc: Add new c_args parameter gtkdoc-scangobj also accepts compiler arguments. In the same way that include_directories includes directories, the new c_args parameter also appends compiler arguments. --- docs/markdown/Gnome-module.md | 1 + mesonbuild/modules/gnome.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md index cc85d87d0..8bf1b5741 100644 --- a/docs/markdown/Gnome-module.md +++ b/docs/markdown/Gnome-module.md @@ -334,6 +334,7 @@ of the module. * `mkdb_args`: a list of arguments to pass to `gtkdoc-mkdb` * `scan_args`: a list of arguments to pass to `gtkdoc-scan` * `scanobjs_args`: a list of arguments to pass to `gtkdoc-scangobj` +* `c_args`: (*Added 0.48.0*) additional compile arguments to pass * `src_dir`: include_directories to include This creates a `$module-doc` target that can be ran to build docs and diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 8a994489f..780247285 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -882,6 +882,7 @@ This will become a hard error in the future.''') rv = [inscript, pottarget, potarget] return ModuleReturnValue(None, rv) + @FeatureNewKwargs('gnome.gtkdoc', '0.48.0', ['c_args']) @FeatureNewKwargs('gnome.gtkdoc', '0.37.0', ['namespace', 'mode']) @permittedKwargs({'main_xml', 'main_sgml', 'src_dir', 'dependencies', 'install', 'install_dir', 'scan_args', 'scanobjs_args', 'gobject_typesfile', @@ -989,7 +990,9 @@ This will become a hard error in the future.''') def _get_build_args(self, kwargs, state, depends): args = [] deps = extract_as_list(kwargs, 'dependencies', unholder=True) - cflags, internal_ldflags, external_ldflags, gi_includes = \ + cflags = OrderedSet() + cflags.update(mesonlib.stringlistify(kwargs.pop('c_args', []))) + deps_cflags, internal_ldflags, external_ldflags, gi_includes = \ self._get_dependencies_flags(deps, state, depends, include_rpath=True) inc_dirs = mesonlib.extract_as_list(kwargs, 'include_directories') for incd in inc_dirs: @@ -997,6 +1000,7 @@ This will become a hard error in the future.''') raise MesonException( 'Gir include dirs should be include_directories().') + cflags.update(deps_cflags) cflags.update(get_include_args(inc_dirs)) ldflags = OrderedSet() ldflags.update(internal_ldflags)