diff options
author | Patrick Griffis <tingping@tingping.se> | 2016-11-19 14:04:42 -0500 |
---|---|---|
committer | Igor Gnatenko <ignatenko@redhat.com> | 2016-11-20 23:36:21 +0100 |
commit | 8dd32506f468b46ce196900e10c975d936084fcc (patch) | |
tree | 80070484f10899b3589fc9a14041435840d6ea76 /mesonbuild/modules/gnome.py | |
parent | 587a0bb3d14addcacd62282a46957b86d582f1be (diff) | |
download | meson-8dd32506f468b46ce196900e10c975d936084fcc.zip meson-8dd32506f468b46ce196900e10c975d936084fcc.tar.gz meson-8dd32506f468b46ce196900e10c975d936084fcc.tar.bz2 |
gnome.compile_resources(): Add ability to output gresource bundles
Closes #1061
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r-- | mesonbuild/modules/gnome.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 7c4fb1d..4f9db48 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -108,8 +108,19 @@ can not be used with the current version of glib-compiled-resources, due to cmd += mesonlib.stringlistify(kwargs.pop('extra_args', [])) + gresource = kwargs.pop('gresource_bundle', False) + if gresource: + output = args[0] + '.gresource' + name = args[0] + '_gresource' + else: + output = args[0] + '.c' + name = args[0] + '_c' + + if kwargs.get('install', False) and not gresource: + raise MesonException('Only gresource files can be installed') + kwargs['input'] = args[1] - kwargs['output'] = args[0] + '.c' + kwargs['output'] = output kwargs['depends'] = depends if not mesonlib.version_compare(glib_version, gresource_dep_needed_version): # This will eventually go out of sync if dependencies are added @@ -119,7 +130,10 @@ can not be used with the current version of glib-compiled-resources, due to depfile = kwargs['output'] + '.d' kwargs['depfile'] = depfile kwargs['command'] = copy.copy(cmd) + ['--dependency-file', '@DEPFILE@'] - target_c = build.CustomTarget(args[0] + '_c', state.subdir, kwargs) + target_c = build.CustomTarget(name, state.subdir, kwargs) + + if gresource: # Only one target for .gresource files + return [target_c] h_kwargs = { 'command': cmd, |