aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2016-08-28 18:18:17 -0400
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2016-09-28 18:20:18 -0400
commitceee8bc6b26eb2d7ec45090a3945853456d895a0 (patch)
tree6b80bbbfbfa28e929da469513182cb86352d4f9e
parent2a8a0727fcf84fa0bb8d4b4eb095594976b30ef9 (diff)
downloadmeson-ceee8bc6b26eb2d7ec45090a3945853456d895a0.zip
meson-ceee8bc6b26eb2d7ec45090a3945853456d895a0.tar.gz
meson-ceee8bc6b26eb2d7ec45090a3945853456d895a0.tar.bz2
Generate genmarshal header and body simultaneously.
This follows the same style as gnome.compile_resources, which produces both files from one invocation.
-rw-r--r--mesonbuild/modules/gnome.py29
-rw-r--r--test cases/frameworks/7 gnome/genmarshal/meson.build10
2 files changed, 25 insertions, 14 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 5f0f737..edd3f93 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -535,10 +535,11 @@ class GnomeModule:
'Sources keyword argument must be a string or array.')
cmd = ['glib-genmarshal']
- known_kwargs = ['body', 'header', 'internal', 'nostdinc',
- 'skip-source', 'stdinc', 'valist-marshallers']
- known_custom_target_kwargs = ['install', 'install_dir', 'build_always',
- 'depends', 'depend_files']
+ known_kwargs = ['internal', 'nostdinc', 'skip-source', 'stdinc',
+ 'valist-marshallers']
+ known_custom_target_kwargs = ['build_always', 'depends',
+ 'depend_files', 'install_dir',
+ 'install_header']
for arg, value in kwargs.items():
if arg == 'prefix':
cmd += ['--prefix', value]
@@ -548,18 +549,30 @@ class GnomeModule:
raise MesonException(
'Genmarshal does not take a %s keyword argument.' % (
arg, ))
- cmd += ['@INPUT@']
+
+ install_header = kwargs.pop('install_header', False)
+ install_dir = kwargs.pop('install_dir', None)
custom_kwargs = {
'input': sources,
- 'output': output,
'capture': True,
- 'command': cmd
}
for arg in known_custom_target_kwargs:
if arg in kwargs:
custom_kwargs[arg] = kwargs[arg]
- return build.CustomTarget(output, state.subdir, custom_kwargs)
+
+ custom_kwargs['command'] = cmd + ['--header', '--body', '@INPUT@']
+ custom_kwargs['output'] = output + '.c'
+ body = build.CustomTarget(output + '_c', state.subdir, custom_kwargs)
+
+ custom_kwargs['install'] = install_header
+ if install_dir is not None:
+ custom_kwargs['install_dir'] = install_dir
+ custom_kwargs['command'] = cmd + ['--header', '@INPUT@']
+ custom_kwargs['output'] = output + '.h'
+ header = build.CustomTarget(output + '_h', state.subdir, custom_kwargs)
+
+ return [body, header]
def initialize():
diff --git a/test cases/frameworks/7 gnome/genmarshal/meson.build b/test cases/frameworks/7 gnome/genmarshal/meson.build
index 8cebb85..4a1a7f9 100644
--- a/test cases/frameworks/7 gnome/genmarshal/meson.build
+++ b/test cases/frameworks/7 gnome/genmarshal/meson.build
@@ -1,12 +1,10 @@
-marshaller_h = gnome.genmarshal('marshaller.h',
+marshallers = gnome.genmarshal('marshaller',
sources : 'marshaller.list',
-header : true,
-install : true,
+install_header : true,
install_dir : get_option('includedir'))
-marshaller_c = gnome.genmarshal('marshaller.c',
-sources : 'marshaller.list',
-body : true)
+marshaller_c = marshallers[0]
+marshaller_h = marshallers[1]
genmarshalexe = executable('genmarshalprog', 'main.c', marshaller_c, marshaller_h,
dependencies : gobj)