From e44587fc735f096eff179cd292015eb8999e1fe3 Mon Sep 17 00:00:00 2001 From: Laurin-Luis Lehning <65224843+e820@users.noreply.github.com> Date: Thu, 17 Jun 2021 21:22:26 +0200 Subject: [PATCH] interpreter: Consider the compiler language before checking arguments --- mesonbuild/interpreter/interpreter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 6679aafd5..95537fd07 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -2402,10 +2402,13 @@ This will become a hard error in the future.''' % kwargs['input'], location=self try: if kwargs['required']: - compilers = self.coredata.compilers.build.values() if kwargs['native'] \ + compilers = self.coredata.compilers.build.values() if kwargs['native'] == MachineChoice.BUILD \ else self.coredata.compilers.host.values() for c in compilers: + if not c.language in kwargs['language']: + continue + for arg in args: if not c.has_multi_arguments([arg], self.environment)[0]: raise mesonlib.MesonException(f'C compiler does not support "{arg}"')