def compile_resources(self, state, args, kwargs): cmd = ['glib-compile-resources', '@INPUT@', '--generate'] if 'source_dir' in kwargs: d = os.path.join(state.build_to_src, state.subdir, kwargs.pop('source_dir')) cmd += ['--sourcedir', d] if 'c_name' in kwargs: cmd += ['--c-name', kwargs.pop('c_name')] cmd += ['--target', '@OUTPUT@'] kwargs['command'] = cmd output_c = args[0] + '.c' output_h = args[0] + '.h' kwargs['input'] = args[1] kwargs['output'] = output_c target_c = build.CustomTarget(args[0]+'_c', state.subdir, kwargs) kwargs['output'] = output_h target_h = build.CustomTarget(args[0] + '_h', state.subdir, kwargs) return [target_c, target_h]
def compile_resources(self, state, args, kwargs): cmd = ['glib-compile-resources', '@INPUT@', '--generate'] if 'source_dir' in kwargs: resource_loc = os.path.join(state.subdir, kwargs.pop('source_dir')) d = os.path.join(state.build_to_src, resource_loc) cmd += ['--sourcedir', d] else: resource_loc = state.subdir if 'c_name' in kwargs: cmd += ['--c-name', kwargs.pop('c_name')] cmd += ['--target', '@OUTPUT@'] kwargs['command'] = cmd output_c = args[0] + '.c' output_h = args[0] + '.h' resfile = args[1] kwargs['depend_files'] = self.parse_gresource_xml( state, resfile, resource_loc) kwargs['input'] = resfile kwargs['output'] = output_c target_c = build.CustomTarget(args[0] + '_c', state.subdir, kwargs) kwargs['output'] = output_h target_h = build.CustomTarget(args[0] + '_h', state.subdir, kwargs) return [target_c, target_h]
def compile_schemas(self, state, args, kwargs): if len(args) != 0: raise MesonException('Compile_schemas does not take positional arguments.') srcdir = os.path.join(state.build_to_src, state.subdir) outdir = state.subdir cmd = ['glib-compile-schemas', '--targetdir', outdir, srcdir] kwargs['command'] = cmd kwargs['input'] = [] kwargs['output'] = 'gschemas.compiled' if state.subdir == '': targetname = 'gsettings-compile' else: targetname = 'gsettings-compile-' + state.subdir 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', '@OUTDIR@/' + 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)