diff options
author | Patrick Griffis <tingping@tingping.se> | 2017-08-13 12:43:21 -0400 |
---|---|---|
committer | Patrick Griffis <tingping@tingping.se> | 2017-09-25 22:14:11 -0400 |
commit | db096f2c7bc0192957701609d7fad62e9db532e4 (patch) | |
tree | 73d08d4630f4d6b2e7664ed765785a52740af19e | |
parent | 011adc4bd277335ea5829f372e61c25bb2b49595 (diff) | |
download | meson-db096f2c7bc0192957701609d7fad62e9db532e4.tar.gz |
gnome: Add header kwarg to generate_gir()tingping/gir-include-kwarg
This is a commonly used flag so lets make it more obvious.
-rw-r--r-- | docs/markdown/Gnome-module.md | 4 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 8 | ||||
-rw-r--r-- | test cases/frameworks/7 gnome/gir/dep1/meson.build | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md index 99a9c8e9a..d87e10802 100644 --- a/docs/markdown/Gnome-module.md +++ b/docs/markdown/Gnome-module.md @@ -81,6 +81,10 @@ tool so see its documentation for more information. * `includes`: list of gir names to be included, can also be a GirTarget +* `header`: *(Added 0.43.0)* name of main c header to include for the library, e.g. `glib.h` + +* `dependencies`: deps to use during introspection scanning + * `include_directories`: extra include paths to look for gir files * `install`: if true, install the generated files diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 1ab075bd2..71c118b5d 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -393,7 +393,7 @@ class GnomeModule(ExtensionModule): @permittedKwargs({'sources', 'nsversion', 'namespace', 'symbol_prefix', 'identifier_prefix', 'export_packages', 'includes', 'dependencies', 'link_with', 'include_directories', 'install', 'install_dir_gir', 'install_dir_typelib', 'extra_args', - 'packages', 'build_by_default'}) + 'packages', 'header', 'build_by_default'}) def generate_gir(self, state, args, kwargs): if len(args) != 1: raise MesonException('Gir takes one argument') @@ -428,6 +428,12 @@ class GnomeModule(ExtensionModule): scan_command += ['--no-libtool', '--namespace=' + ns, '--nsversion=' + nsversion, '--warn-all', '--output', '@OUTPUT@'] + header = kwargs.pop('header', None) + if header: + if not isinstance(header, str): + raise MesonException('header must be a string') + scan_command += ['--c-include=' + header] + extra_args = mesonlib.stringlistify(kwargs.pop('extra_args', [])) scan_command += extra_args scan_command += ['-I' + srcdir, diff --git a/test cases/frameworks/7 gnome/gir/dep1/meson.build b/test cases/frameworks/7 gnome/gir/dep1/meson.build index 75dd73166..baa0b1d68 100644 --- a/test cases/frameworks/7 gnome/gir/dep1/meson.build +++ b/test cases/frameworks/7 gnome/gir/dep1/meson.build @@ -19,6 +19,7 @@ dep1gir = gnome.generate_gir( namespace : 'MesonDep1', symbol_prefix : 'meson', identifier_prefix : 'Meson', + header: 'dep1.h', includes : ['GObject-2.0', 'MesonDep2-1.0'], dependencies : [dep2_dep], install : true |