aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-07-23 19:35:06 +0300
committerGitHub <noreply@github.com>2017-07-23 19:35:06 +0300
commit3bb1ba873b2e8cfd3be0d7c498e166c4817a0dce (patch)
tree41e475b4044f2cb17d0ca691f42ce748d4d0440d
parent094c8dc250167f8fe7789c4014014691e89d80cd (diff)
parent6ba6c174ba9a4fa06d06575e609f2c7bfe3f7d8c (diff)
downloadmeson-3bb1ba873b2e8cfd3be0d7c498e166c4817a0dce.zip
meson-3bb1ba873b2e8cfd3be0d7c498e166c4817a0dce.tar.gz
meson-3bb1ba873b2e8cfd3be0d7c498e166c4817a0dce.tar.bz2
Merge pull request #2049 from ebassi/genmarshal-next
Support glib-genmarshal from GLib 2.54
-rw-r--r--docs/markdown/Gnome-module.md3
-rw-r--r--mesonbuild/modules/gnome.py16
-rw-r--r--test cases/frameworks/7 gnome/genmarshal/meson.build3
3 files changed, 18 insertions, 4 deletions
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md
index d01deaf..3476d34 100644
--- a/docs/markdown/Gnome-module.md
+++ b/docs/markdown/Gnome-module.md
@@ -61,7 +61,8 @@ the output files.
* `internal`: if true, mark generated sources as internal
* `skip_source`: if true, skip source location comments
* `valist_marshallers`: if true, generate va_list marshallers
-
+* `extra_args`: (*Added 0.42.0*) additional command line arguments to pass
+ to `glib-genmarshal` (*Requires GLib 2.54*)
*Added 0.35.0*
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 883799c..addcab3 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -954,7 +954,8 @@ class GnomeModule(ExtensionModule):
absolute_paths=True)
@permittedKwargs({'sources', 'prefix', 'install_header', 'install_dir', 'stdinc',
- 'nostdinc', 'internal', 'skip_source', 'valist_marshallers'})
+ 'nostdinc', 'internal', 'skip_source', 'valist_marshallers',
+ 'extra_args'})
def genmarshal(self, state, args, kwargs):
if len(args) != 1:
raise MesonException(
@@ -970,15 +971,24 @@ class GnomeModule(ExtensionModule):
raise MesonException(
'Sources keyword argument must be a string or array.')
+ new_genmarshal = mesonlib.version_compare(self._get_native_glib_version(state), '>= 2.53.3')
+
cmd = [find_program('glib-genmarshal', output + '_genmarshal')]
known_kwargs = ['internal', 'nostdinc', 'skip_source', 'stdinc',
- 'valist_marshallers']
+ 'valist_marshallers', 'extra_args']
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]
+ elif arg == 'extra_args':
+ if new_genmarshal:
+ cmd += mesonlib.stringlistify(value, [])
+ else:
+ mlog.warning('The current version of GLib does not support extra arguments \n'
+ 'for glib-genmarshal. You need at least GLib 2.53.3. See ',
+ mlog.bold('https://github.com/mesonbuild/meson/pull/2049'))
elif arg in known_kwargs and value:
cmd += ['--' + arg.replace('_', '-')]
elif arg not in known_custom_target_kwargs:
@@ -1014,6 +1024,8 @@ class GnomeModule(ExtensionModule):
custom_kwargs['install'] = install_header
if install_dir is not None:
custom_kwargs['install_dir'] = install_dir
+ if new_genmarshal:
+ cmd += ['--pragma-once']
custom_kwargs['command'] = cmd + ['--header', '@INPUT@']
custom_kwargs['output'] = header_file
header = build.CustomTarget(output + '_h', state.subdir, custom_kwargs)
diff --git a/test cases/frameworks/7 gnome/genmarshal/meson.build b/test cases/frameworks/7 gnome/genmarshal/meson.build
index 4a1a7f9..d7189f5 100644
--- a/test cases/frameworks/7 gnome/genmarshal/meson.build
+++ b/test cases/frameworks/7 gnome/genmarshal/meson.build
@@ -1,7 +1,8 @@
marshallers = gnome.genmarshal('marshaller',
sources : 'marshaller.list',
install_header : true,
-install_dir : get_option('includedir'))
+install_dir : get_option('includedir'),
+extra_args : ['-UG_ENABLE_DEBUG', '--prototypes'])
marshaller_c = marshallers[0]
marshaller_h = marshallers[1]