aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/i18n.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-08-26 17:47:57 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-08-31 23:37:33 -0400
commit2fc7592e13a4680aa481dfd0859a6591d0f92e74 (patch)
treeefdfd00dc0ed82efb16766e7cbaa4786db510d4b /mesonbuild/modules/i18n.py
parentbd691b847c2cb6cbea3450a8749bcc1a67c295e7 (diff)
downloadmeson-2fc7592e13a4680aa481dfd0859a6591d0f92e74.zip
meson-2fc7592e13a4680aa481dfd0859a6591d0f92e74.tar.gz
meson-2fc7592e13a4680aa481dfd0859a6591d0f92e74.tar.bz2
i18n module: provide targets as return value for gettext()
Users may wish to make use of these files for their own purposes. For example, the -pot and -update-po pseudo targets could be reused in an alias_target(), and at least one person wanted to reuse the built .mo files as custom_target input. Fixes #6227
Diffstat (limited to 'mesonbuild/modules/i18n.py')
-rw-r--r--mesonbuild/modules/i18n.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 539f82b..de86195 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -143,6 +143,7 @@ class I18nModule(ExtensionModule):
datadirs = self._get_data_dirs(state, mesonlib.stringlistify(kwargs.get('data_dirs', [])))
extra_args = mesonlib.stringlistify(kwargs.get('args', []))
targets = []
+ gmotargets = []
preset = kwargs.pop('preset', None)
if preset:
@@ -185,6 +186,7 @@ class I18nModule(ExtensionModule):
}
gmotarget = build.CustomTarget(l+'.mo', path.join(state.subdir, l, 'LC_MESSAGES'), state.subproject, gmo_kwargs)
targets.append(gmotarget)
+ gmotargets.append(gmotarget)
updatepoargs = state.environment.get_build_command() + ['--internal', 'gettext', 'update_po', pkg_arg]
if lang_arg:
@@ -196,7 +198,7 @@ class I18nModule(ExtensionModule):
updatepotarget = build.RunTarget(packagename + '-update-po', updatepoargs, [], state.subdir, state.subproject)
targets.append(updatepotarget)
- return ModuleReturnValue(None, targets)
+ return ModuleReturnValue([gmotargets, pottarget, updatepotarget], targets)
def initialize(*args, **kwargs):
return I18nModule(*args, **kwargs)