diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index d9d81d68b..10114fa43 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -231,10 +231,10 @@ class PGICCompiler(PGICompiler, CCompiler): class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler): def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, defines=None, **kwargs): + is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): GnuCCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, defines, **kwargs) - ElbrusCompiler.__init__(self, defines) + info, exe_wrapper, **kwargs) + ElbrusCompiler.__init__(self) # It does support some various ISO standards and c/gnu 90, 9x, 1x in addition to those which GNU CC supports. def get_options(self): diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index a09c6112e..2ed969ae5 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -325,7 +325,7 @@ class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): GnuCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, defines, **kwargs) - ElbrusCompiler.__init__(self, defines) + ElbrusCompiler.__init__(self) # It does not support c++/gnu++ 17 and 1z, but still does support 0x, 1y, and gnu++98. def get_options(self): diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 73a8e241a..a83c17f4e 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -215,7 +215,7 @@ class ElbrusFortranCompiler(GnuFortranCompiler, ElbrusCompiler): GnuFortranCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, defines, **kwargs) - ElbrusCompiler.__init__(self, defines) + ElbrusCompiler.__init__(self) class G95FortranCompiler(FortranCompiler): diff --git a/mesonbuild/compilers/mixins/elbrus.py b/mesonbuild/compilers/mixins/elbrus.py index 87bf52a2f..1420474f3 100644 --- a/mesonbuild/compilers/mixins/elbrus.py +++ b/mesonbuild/compilers/mixins/elbrus.py @@ -29,7 +29,7 @@ if T.TYPE_CHECKING: class ElbrusCompiler(GnuLikeCompiler): # Elbrus compiler is nearly like GCC, but does not support # PCH, LTO, sanitizers and color output as of version 1.21.x. - def __init__(self, defines: T.Dict[str, str]): + def __init__(self): super().__init__() self.id = 'lcc' self.base_options = ['b_pgo', 'b_coverage', diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 58c9e996b..da670f35f 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -939,10 +939,17 @@ class Environment: cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler linker = self._guess_nix_linker(compiler, cls, for_machine) - return cls( - ccache + compiler, version, for_machine, is_cross, - info, exe_wrap, defines, full_version=full_version, - linker=linker) + + if lang == 'c': # There's no 'defines' anymore in C Compiler classes. + return cls( + ccache + compiler, version, for_machine, is_cross, + info, exe_wrap, full_version=full_version, + linker=linker) + else: + return cls( + ccache + compiler, version, for_machine, is_cross, + info, exe_wrap, defines, full_version=full_version, + linker=linker) if 'Emscripten' in out: cls = EmscriptenCCompiler if lang == 'c' else EmscriptenCPPCompiler