aboutsummaryrefslogtreecommitdiff
path: root/modules/gnome.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-03-14 19:05:34 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2015-03-14 19:05:34 +0200
commit9741f7527705d2ac4f515e1d085f89bc85e1fa03 (patch)
treef3ee4597c634555d75e4212ee26211b98baf1e60 /modules/gnome.py
parent9e1700cbfeaaa751fb5a0d385d6ea18d69a5ac1c (diff)
downloadmeson-9741f7527705d2ac4f515e1d085f89bc85e1fa03.zip
meson-9741f7527705d2ac4f515e1d085f89bc85e1fa03.tar.gz
meson-9741f7527705d2ac4f515e1d085f89bc85e1fa03.tar.bz2
Created gdbus-codegen helper in the gnome module.
Diffstat (limited to 'modules/gnome.py')
-rw-r--r--modules/gnome.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/gnome.py b/modules/gnome.py
index f6d13a9..c0e391f 100644
--- a/modules/gnome.py
+++ b/modules/gnome.py
@@ -89,6 +89,24 @@ class GnomeModule:
target_g = build.CustomTarget(targetname, state.subdir, kwargs)
return target_g
+ def gdbus_codegen(self, state, args, kwargs):
+ if len(args) != 2:
+ raise MesonException('Gdbus_codegen takes two arguments, name and xml file.')
+ namebase = args[0]
+ xml_file = args[1]
+ cmd = ['gdbus-codegen']
+ if 'interface_prefix' in kwargs:
+ cmd += ['--interface-prefix', kwargs.pop('interface_prefix')]
+ if 'namespace' in kwargs:
+ cmd += ['--c-namespace', kwargs.pop('namespace')]
+ cmd += ['--generate-c-code', os.path.join(state.subdir, namebase), '@INPUT@']
+ outputs = [namebase + '.c', namebase + '.h']
+ custom_kwargs = {'input' : xml_file,
+ 'output' : outputs,
+ 'command' : cmd
+ }
+ return build.CustomTarget(namebase + '-gdbus', state.subdir, custom_kwargs)
+
def initialize():
mlog.log('Warning, glib compiled dependencies will not work until this upstream issue is fixed:',
mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=745754'))