aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-09-21 10:38:17 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-09-24 12:14:13 -0700
commit2c0fbe161d61d2d15d29892456544442ab1c4ff6 (patch)
tree18eea4af185465640f29727a3761e3b1af5c36fc /mesonbuild/compilers/compilers.py
parent1592b7a800c3b109a1b502bfb03f4e21827da334 (diff)
downloadmeson-2c0fbe161d61d2d15d29892456544442ab1c4ff6.zip
meson-2c0fbe161d61d2d15d29892456544442ab1c4ff6.tar.gz
meson-2c0fbe161d61d2d15d29892456544442ab1c4ff6.tar.bz2
compilers: make is_cross part of the base Compiler class
Every class needs to set this, so it should be part of the base. For classes that require is_cross, the positional argument remains in their signature. For those that don't, they just allow the base class to set their value to it's default of False.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 44922eb..b1a572f 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -456,7 +456,7 @@ class Compiler(metaclass=abc.ABCMeta):
def __init__(self, exelist: T.List[str], version: str,
for_machine: MachineChoice, info: 'MachineInfo',
linker: T.Optional['DynamicLinker'] = None,
- full_version: T.Optional[str] = None):
+ full_version: T.Optional[str] = None, is_cross: bool = False):
self.exelist = exelist
# In case it's been overridden by a child class already
if not hasattr(self, 'file_suffixes'):
@@ -470,6 +470,7 @@ class Compiler(metaclass=abc.ABCMeta):
self.base_options = [] # type: T.List[str]
self.linker = linker
self.info = info
+ self.is_cross = is_cross
def __repr__(self) -> str:
repr_str = "<{0}: v{1} `{2}`>"