aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-11-25 11:45:17 -0800
committerDylan Baker <dylan@pnwbakers.com>2019-12-12 09:35:30 -0800
commitee6e249f659cd4658ae2f1a425d4aa01585c23aa (patch)
tree6de9864f5af4ff60409d99b43c2cbe0f13d2618b /mesonbuild/compilers/c.py
parent0bf8862bebf6057b3020443cee4238d6db5638d0 (diff)
downloadmeson-ee6e249f659cd4658ae2f1a425d4aa01585c23aa.zip
meson-ee6e249f659cd4658ae2f1a425d4aa01585c23aa.tar.gz
meson-ee6e249f659cd4658ae2f1a425d4aa01585c23aa.tar.bz2
compilers: move language attribute to the class level
We know that if a compiler class inherits CCompiler it's language will be C, so doing this at the class level makes more sense.
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index db7abf0..42948a0 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -48,10 +48,11 @@ class CCompiler(CLikeCompiler, Compiler):
except KeyError:
raise MesonException('Unknown function attribute "{}"'.format(name))
+ language = 'c'
+
def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: typing.Optional[str] = None, **kwargs):
# If a child ObjC or CPP class has already set it, don't set it ourselves
- self.language = 'c'
Compiler.__init__(self, exelist, version, for_machine, info, **kwargs)
CLikeCompiler.__init__(self, is_cross, exe_wrapper)