aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakise-homura <akemi_homura@kurisa.ch>2020-01-23 23:45:41 +0300
committerNirbheek Chauhan <nirbheek@centricular.com>2020-02-17 23:43:22 +0530
commitc6a5e05eefd2f05300cd493c37ca5430137cca18 (patch)
tree5caa9513fb78eb245d4c3a7b91f1f830953c7033
parent29c0dc69b15400d74ced5c5e29c85a93c4b32b8d (diff)
downloadmeson-c6a5e05eefd2f05300cd493c37ca5430137cca18.zip
meson-c6a5e05eefd2f05300cd493c37ca5430137cca18.tar.gz
meson-c6a5e05eefd2f05300cd493c37ca5430137cca18.tar.bz2
Bringing back defines in Elbrus C compiler to simplify environment.py
-rw-r--r--mesonbuild/compilers/c.py5
-rw-r--r--mesonbuild/environment.py14
2 files changed, 7 insertions, 12 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 10114fa..4647562 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -231,9 +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, **kwargs):
+ is_cross, info: 'MachineInfo', exe_wrapper=None,
+ defines=None, **kwargs):
GnuCCompiler.__init__(self, exelist, version, for_machine, is_cross,
- info, exe_wrapper, **kwargs)
+ info, exe_wrapper, defines, **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.
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 7dd0d29..ef9480b 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -948,16 +948,10 @@ class Environment:
linker = self._guess_nix_linker(compiler, cls, for_machine)
- 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)
+ 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