diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-03-17 16:47:58 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-09-09 13:38:59 +0100 |
commit | d712c86a623ed11d7c2918d8161fdf76ff4586f2 (patch) | |
tree | 7d5f890b9c7b9ca4630de29b85c1996db74b83c6 /mesonbuild/ast | |
parent | f94e1eed97930a5cae6371b20013f55af6d1ab94 (diff) | |
download | meson-d712c86a623ed11d7c2918d8161fdf76ff4586f2.zip meson-d712c86a623ed11d7c2918d8161fdf76ff4586f2.tar.gz meson-d712c86a623ed11d7c2918d8161fdf76ff4586f2.tar.bz2 |
Implement add_languages(native:) in introspector
Diffstat (limited to 'mesonbuild/ast')
-rw-r--r-- | mesonbuild/ast/introspection.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 8a8de01..009fdb0 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -138,8 +138,13 @@ class IntrospectionInterpreter(AstInterpreter): return def func_add_languages(self, node: BaseNode, args: T.List[TYPE_nvar], kwargs: T.Dict[str, TYPE_nvar]) -> None: - for for_machine in [MachineChoice.BUILD, MachineChoice.HOST]: - self._add_languages(args, for_machine) + kwargs = self.flatten_kwargs(kwargs) + if 'native' in kwargs: + native = kwargs.get('native', False) + self._add_languages(args, MachineChoice.BUILD if native else MachineChoice.HOST) + else: + for for_machine in [MachineChoice.BUILD, MachineChoice.HOST]: + self._add_languages(args, for_machine) def _add_languages(self, langs: T.List[TYPE_nvar], for_machine: MachineChoice) -> None: langs = self.flatten_args(langs) |