From 17eb224aa7e7af17b50c39a224db54f895af578d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 27 Apr 2021 12:19:58 -0700 Subject: interpreter: Automatically add 'c' to languages when 'vala' is used This is so dumb, we can just insert C for you without you having to know that you're using C under the hood. This is nicer because: 1) Meson doesn't make the user add a language they're not explicitly using 2) If there was ever an implementaiton of Vala that didn't use C as it's assembly language, this wouldn't make any sense. --- mesonbuild/interpreter/interpreter.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mesonbuild/interpreter/interpreter.py') diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 484db78..170092d 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1187,13 +1187,12 @@ external dependencies (including libraries) must go to "dependencies".''') return False return should - def add_languages_for(self, args, required, for_machine: MachineChoice): + def add_languages_for(self, args: T.List[str], required: bool, for_machine: MachineChoice) -> None: args = [a.lower() for a in args] langs = set(self.coredata.compilers[for_machine].keys()) langs.update(args) - if 'vala' in langs: - if 'c' not in langs: - raise InterpreterException('Compiling Vala requires C. Add C to your project languages and rerun Meson.') + if 'vala' in langs and 'c' not in langs: + args.append('c') success = True for lang in sorted(args, key=compilers.sort_clink): -- cgit v1.1