Fix missing 'defines' argumet for Elbrus compiler

...But somehow it still remains in C++ compiler.
pull/6455/head
makise-homura 5 years ago
parent a493761d89
commit 7321cc776a
  1. 6
      mesonbuild/compilers/c.py
  2. 2
      mesonbuild/compilers/cpp.py
  3. 2
      mesonbuild/compilers/fortran.py
  4. 2
      mesonbuild/compilers/mixins/elbrus.py
  5. 15
      mesonbuild/environment.py

@ -231,10 +231,10 @@ class PGICCompiler(PGICompiler, CCompiler):
class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler): class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler):
def __init__(self, exelist, version, for_machine: MachineChoice, 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, GnuCCompiler.__init__(self, exelist, version, for_machine, is_cross,
info, exe_wrapper, defines, **kwargs) info, exe_wrapper, **kwargs)
ElbrusCompiler.__init__(self, defines) ElbrusCompiler.__init__(self)
# It does support some various ISO standards and c/gnu 90, 9x, 1x in addition to those which GNU CC supports. # 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): def get_options(self):

@ -325,7 +325,7 @@ class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler):
GnuCPPCompiler.__init__(self, exelist, version, for_machine, GnuCPPCompiler.__init__(self, exelist, version, for_machine,
is_cross, info, exe_wrapper, defines, is_cross, info, exe_wrapper, defines,
**kwargs) **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. # It does not support c++/gnu++ 17 and 1z, but still does support 0x, 1y, and gnu++98.
def get_options(self): def get_options(self):

@ -215,7 +215,7 @@ class ElbrusFortranCompiler(GnuFortranCompiler, ElbrusCompiler):
GnuFortranCompiler.__init__(self, exelist, version, for_machine, GnuFortranCompiler.__init__(self, exelist, version, for_machine,
is_cross, info, exe_wrapper, defines, is_cross, info, exe_wrapper, defines,
**kwargs) **kwargs)
ElbrusCompiler.__init__(self, defines) ElbrusCompiler.__init__(self)
class G95FortranCompiler(FortranCompiler): class G95FortranCompiler(FortranCompiler):

@ -29,7 +29,7 @@ if T.TYPE_CHECKING:
class ElbrusCompiler(GnuLikeCompiler): class ElbrusCompiler(GnuLikeCompiler):
# Elbrus compiler is nearly like GCC, but does not support # Elbrus compiler is nearly like GCC, but does not support
# PCH, LTO, sanitizers and color output as of version 1.21.x. # 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__() super().__init__()
self.id = 'lcc' self.id = 'lcc'
self.base_options = ['b_pgo', 'b_coverage', self.base_options = ['b_pgo', 'b_coverage',

@ -939,10 +939,17 @@ class Environment:
cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler
linker = self._guess_nix_linker(compiler, cls, for_machine) linker = self._guess_nix_linker(compiler, cls, for_machine)
return cls(
ccache + compiler, version, for_machine, is_cross, if lang == 'c': # There's no 'defines' anymore in C Compiler classes.
info, exe_wrap, defines, full_version=full_version, return cls(
linker=linker) 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: if 'Emscripten' in out:
cls = EmscriptenCCompiler if lang == 'c' else EmscriptenCPPCompiler cls = EmscriptenCCompiler if lang == 'c' else EmscriptenCPPCompiler

Loading…
Cancel
Save