From 9741f7527705d2ac4f515e1d085f89bc85e1fa03 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 14 Mar 2015 19:05:34 +0200 Subject: Created gdbus-codegen helper in the gnome module. --- modules/gnome.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules/gnome.py') diff --git a/modules/gnome.py b/modules/gnome.py index f6d13a952..c0e391f2d 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')) -- cgit v1.2.3