From 10817381131ba58b243e13d76f97be59d65a5a8a Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 12 Feb 2020 19:13:43 +0000 Subject: [PATCH] Check before compiler detection if 'c' language is present when adding 'vala' For the sake of a consistent error message (irrespective of if 'valac' is present or not), check if the 'c' language is present if we are adding 'vala' before (rather than after) we do compiler detection. --- mesonbuild/interpreter.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 11eceae58..9811b0af5 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -3117,6 +3117,12 @@ external dependencies (including libraries) must go to "dependencies".''') return should def add_languages_for(self, args, required, for_machine: MachineChoice): + 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.') + success = True for lang in sorted(args, key=compilers.sort_clink): lang = lang.lower() @@ -3154,11 +3160,6 @@ external dependencies (including libraries) must go to "dependencies".''') mlog.bold(' '.join(comp.linker.get_exelist())), comp.linker.id, comp.linker.version) self.build.ensure_static_linker(comp) - langs = self.coredata.compilers[for_machine].keys() - if 'vala' in langs: - if 'c' not in langs: - raise InterpreterException('Compiling Vala requires C. Add C to your project languages and rerun Meson.') - return success def program_from_file_for(self, for_machine, prognames, silent):