From ee6e249f659cd4658ae2f1a425d4aa01585c23aa Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 25 Nov 2019 11:45:17 -0800 Subject: 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. --- mesonbuild/compilers/cpp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mesonbuild/compilers/cpp.py') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 6d45a842b..0cf77ab46 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -59,10 +59,11 @@ class CPPCompiler(CLikeCompiler, Compiler): except KeyError: raise MesonException('Unknown function attribute "{}"'.format(name)) + language = 'cpp' + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, info: 'MachineInfo', exe_wrap: typing.Optional[str] = None, **kwargs): # If a child ObjCPP class has already set it, don't set it ourselves - self.language = 'cpp' Compiler.__init__(self, exelist, version, for_machine, info, **kwargs) CLikeCompiler.__init__(self, is_cross, exe_wrap) -- cgit v1.2.3