diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-10-04 20:52:08 -0400 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2019-06-09 13:13:25 -0400 |
commit | 07777e15d47dbddaf849d24b3a30c85745c533ca (patch) | |
tree | f472472ed511498c329b4e13e19b1585e1afb621 /mesonbuild/compilers/cs.py | |
parent | 32e827dcdc451e1c5dde952cf08e4b654eac7057 (diff) | |
download | meson-07777e15d47dbddaf849d24b3a30c85745c533ca.zip meson-07777e15d47dbddaf849d24b3a30c85745c533ca.tar.gz meson-07777e15d47dbddaf849d24b3a30c85745c533ca.tar.bz2 |
Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.
As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
Diffstat (limited to 'mesonbuild/compilers/cs.py')
-rw-r--r-- | mesonbuild/compilers/cs.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py index c6355f2..8069ab1 100644 --- a/mesonbuild/compilers/cs.py +++ b/mesonbuild/compilers/cs.py @@ -17,7 +17,7 @@ import os.path, subprocess from ..mesonlib import EnvironmentException from ..mesonlib import is_windows -from .compilers import Compiler, mono_buildtype_args +from .compilers import Compiler, MachineChoice, mono_buildtype_args cs_optimization_args = {'0': [], 'g': [], @@ -28,9 +28,9 @@ cs_optimization_args = {'0': [], } class CsCompiler(Compiler): - def __init__(self, exelist, version, comp_id, runner=None): + def __init__(self, exelist, version, for_machine: MachineChoice, comp_id, runner=None): self.language = 'cs' - super().__init__(exelist, version) + super().__init__(exelist, version, for_machine) self.id = comp_id self.is_cross = False self.runner = runner @@ -143,14 +143,14 @@ class CsCompiler(Compiler): return cs_optimization_args[optimization_level] class MonoCompiler(CsCompiler): - def __init__(self, exelist, version): - super().__init__(exelist, version, 'mono', + def __init__(self, exelist, version, for_machine: MachineChoice): + super().__init__(exelist, version, for_machine, 'mono', 'mono') class VisualStudioCsCompiler(CsCompiler): - def __init__(self, exelist, version): - super().__init__(exelist, version, 'csc') + def __init__(self, exelist, version, for_machine: MachineChoice): + super().__init__(exelist, version, for_machine, 'csc') def get_buildtype_args(self, buildtype): res = mono_buildtype_args[buildtype] |