aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/modules/i18n.py7
-rw-r--r--mesonbuild/scripts/msgfmthelper.py3
2 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 4b37069..76b9d63 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -64,7 +64,8 @@ class I18nModule(ExtensionModule):
return [path.join(src_dir, d) for d in dirs]
@FeatureNew('i18n.merge_file', '0.37.0')
- @permittedKwargs(build.CustomTarget.known_kwargs | {'data_dirs', 'po_dir', 'type'})
+ @FeatureNewKwargs('i18n.merge_file', '0.51.0', ['args'])
+ @permittedKwargs(build.CustomTarget.known_kwargs | {'data_dirs', 'po_dir', 'type', 'args'})
def merge_file(self, state, args, kwargs):
podir = kwargs.pop('po_dir', None)
if not podir:
@@ -86,6 +87,10 @@ class I18nModule(ExtensionModule):
if datadirs:
command.append(datadirs)
+ if 'args' in kwargs:
+ command.append('--')
+ command.append(mesonlib.stringlistify(kwargs.pop('args', [])))
+
kwargs['command'] = command
inputfile = kwargs['input']
diff --git a/mesonbuild/scripts/msgfmthelper.py b/mesonbuild/scripts/msgfmthelper.py
index d4deb00..737f1bc 100644
--- a/mesonbuild/scripts/msgfmthelper.py
+++ b/mesonbuild/scripts/msgfmthelper.py
@@ -22,6 +22,7 @@ parser.add_argument('output')
parser.add_argument('type')
parser.add_argument('podir')
parser.add_argument('--datadirs', default='')
+parser.add_argument('args', default=[], metavar='extra msgfmt argument', nargs='*')
def run(args):
@@ -31,5 +32,5 @@ def run(args):
env = os.environ.copy()
env.update({'GETTEXTDATADIRS': options.datadirs})
return subprocess.call(['msgfmt', '--' + options.type, '-d', options.podir,
- '--template', options.input, '-o', options.output],
+ '--template', options.input, '-o', options.output] + options.args,
env=env)