aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-04-27 12:19:58 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2021-05-19 23:28:17 +0300
commit17eb224aa7e7af17b50c39a224db54f895af578d (patch)
tree92e7c977afcfa5425bfc03bf16f21ce33eeec122 /mesonbuild
parentbfd06783bd999a59fb0a375d35c25a4ae7b3e17e (diff)
downloadmeson-17eb224aa7e7af17b50c39a224db54f895af578d.zip
meson-17eb224aa7e7af17b50c39a224db54f895af578d.tar.gz
meson-17eb224aa7e7af17b50c39a224db54f895af578d.tar.bz2
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.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter/interpreter.py7
1 files changed, 3 insertions, 4 deletions
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):