diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-12 19:13:43 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-04-30 20:11:33 +0100 |
commit | 10817381131ba58b243e13d76f97be59d65a5a8a (patch) | |
tree | 4823e5b4501577062091d8029dfc71331f37821e | |
parent | 6a5c6fb439c9351d513c63ff7eb028dde4c3f1c0 (diff) | |
download | meson-10817381131ba58b243e13d76f97be59d65a5a8a.tar.gz |
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.
-rw-r--r-- | mesonbuild/interpreter.py | 11 |
1 files 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): |