diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-05 21:18:46 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-06 11:09:56 -0500 |
commit | 1f3640c7dbce18ba11b6f383c3ad5c454a8a2c1d (patch) | |
tree | da4b09b38cbdb0ecca28215b97015f3b2488b0ff /mesonbuild/modules | |
parent | 08928821ec00bb7e74cbf791e1f42eefd134379e (diff) | |
download | meson-1f3640c7dbce18ba11b6f383c3ad5c454a8a2c1d.zip meson-1f3640c7dbce18ba11b6f383c3ad5c454a8a2c1d.tar.gz meson-1f3640c7dbce18ba11b6f383c3ad5c454a8a2c1d.tar.bz2 |
i18n module: report initial call site when disabling translation support
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/i18n.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py index 1eeb9ad..04d0696 100644 --- a/mesonbuild/modules/i18n.py +++ b/mesonbuild/modules/i18n.py @@ -32,6 +32,7 @@ if T.TYPE_CHECKING: from ..build import Target from ..interpreter import Interpreter from ..interpreterbase import TYPE_var + from ..mparser import BaseNode from ..programs import ExternalProgram class MergeFile(TypedDict): @@ -140,8 +141,8 @@ class I18nModule(ExtensionModule): } @staticmethod - def nogettext_warning() -> None: - mlog.warning('Gettext not found, all translation targets will be ignored.', once=True) + def nogettext_warning(location: BaseNode) -> None: + mlog.warning('Gettext not found, all translation targets will be ignored.', once=True, location=location) @staticmethod def _get_data_dirs(state: 'ModuleState', dirs: T.Iterable[str]) -> T.List[str]: @@ -168,7 +169,7 @@ class I18nModule(ExtensionModule): if self.tools['msgfmt'] is None: self.tools['msgfmt'] = state.find_program('msgfmt', required=False, for_machine=mesonlib.MachineChoice.BUILD) if not self.tools['msgfmt'].found(): - self.nogettext_warning() + self.nogettext_warning(state.current_node) return ModuleReturnValue(None, []) podir = path.join(state.build_to_src, state.subdir, kwargs['po_dir']) @@ -229,7 +230,7 @@ class I18nModule(ExtensionModule): self.tools[tool] = state.find_program(tool, required=False, for_machine=mesonlib.MachineChoice.BUILD) # still not found? if not self.tools[tool].found(): - self.nogettext_warning() + self.nogettext_warning(state.current_node) return ModuleReturnValue(None, []) packagename = args[0] pkg_arg = f'--pkgname={packagename}' |