diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-06-09 16:27:51 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2020-06-16 08:21:35 -0400 |
commit | 0b4cf5a8447610a8d5a2101ecbac013fc0420811 (patch) | |
tree | 4a81436bfac80cd13a78277a99c56b076f7207c3 /mesonbuild/modules/gnome.py | |
parent | 0a61f511aa1960ac0d3f9b5e50e35f5f603b99b7 (diff) | |
download | meson-0b4cf5a8447610a8d5a2101ecbac013fc0420811.zip meson-0b4cf5a8447610a8d5a2101ecbac013fc0420811.tar.gz meson-0b4cf5a8447610a8d5a2101ecbac013fc0420811.tar.bz2 |
gnome: Add fatal_warnings kwarg to generate_gir()
Fixes: #7130
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r-- | mesonbuild/modules/gnome.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index ea1b325..d541eee 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -721,11 +721,12 @@ class GnomeModule(ExtensionModule): if f.startswith(('-L', '-l', '--extra-library')): yield f - @FeatureNewKwargs('build target', '0.40.0', ['build_by_default']) + @FeatureNewKwargs('generate_gir', '0.55.0', ['fatal_warnings']) + @FeatureNewKwargs('generate_gir', '0.40.0', ['build_by_default']) @permittedKwargs({'sources', 'nsversion', 'namespace', 'symbol_prefix', 'identifier_prefix', 'export_packages', 'includes', 'dependencies', 'link_with', 'include_directories', 'install', 'install_dir_gir', 'install_dir_typelib', 'extra_args', - 'packages', 'header', 'build_by_default'}) + 'packages', 'header', 'build_by_default', 'fatal_warnings'}) def generate_gir(self, state, args, kwargs): if not args: raise MesonException('generate_gir takes at least one argument') @@ -798,6 +799,14 @@ class GnomeModule(ExtensionModule): scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_source_dir(), self.interpreter.subproject_dir, state.subproject)] scan_command += ['--sources-top-dirs', os.path.join(state.environment.get_build_dir(), self.interpreter.subproject_dir, state.subproject)] + if '--warn-error' in scan_command: + mlog.deprecation('Passing --warn-error is deprecated in favor of "fatal_warnings" keyword argument') + fatal_warnings = kwargs.get('fatal_warnings', False) + if not isinstance(fatal_warnings, bool): + raise MesonException('fatal_warnings keyword argument must be string.') + if fatal_warnings: + scan_command.append('--warn-error') + scan_target = self._make_gir_target(state, girfile, scan_command, depends, kwargs) typelib_output = '%s-%s.typelib' % (ns, nsversion) |