def compile_resources(self, state, args, kwargs):
        self.__print_gresources_warning()

        cmd = ['glib-compile-resources', '@INPUT@']

        source_dirs = kwargs.pop('source_dir', [])
        if not isinstance(source_dirs, list):
            source_dirs = [source_dirs]

        ifile = args[1]
        if isinstance(ifile, mesonlib.File):
            ifile = os.path.join(ifile.subdir, ifile.fname)
        elif isinstance(ifile, str):
            ifile = os.path.join(state.subdir, ifile)
        else:
            raise RuntimeError('Unreachable code.')
        kwargs['depend_files'] = self.get_gresource_dependencies(state, ifile, source_dirs)

        for source_dir in source_dirs:
            sourcedir = os.path.join(state.build_to_src, state.subdir, source_dir)
            cmd += ['--sourcedir', sourcedir]

        if 'c_name' in kwargs:
            cmd += ['--c-name', kwargs.pop('c_name')]
        cmd += ['--generate', '--target', '@OUTPUT@']

        kwargs['command'] = cmd
        kwargs['input'] = args[1]
        kwargs['output'] = args[0] + '.c'
        target_c = build.CustomTarget(args[0] + '_c', state.subdir, kwargs)
        kwargs['output'] = args[0] + '.h'
        target_h = build.CustomTarget(args[0] + '_h', state.subdir, kwargs)
        return [target_c, target_h]
dataset/ETHPy150Open mesonbuild/meson/mesonbuild/modules/gnome.py/GnomeModule.compile_resources/original