aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-09-30 14:46:10 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-10-25 17:24:56 -0400
commit2961adb8c89fa8ccfbc8e24cd9f1115bd3abeee1 (patch)
treea52ebb2666ba207caf94ca38b4e111390a6124e1 /mesonbuild/compilers/c.py
parentb0e2d00acd67e13ac3478cb7f00a080d702bb8d7 (diff)
downloadmeson-2961adb8c89fa8ccfbc8e24cd9f1115bd3abeee1.zip
meson-2961adb8c89fa8ccfbc8e24cd9f1115bd3abeee1.tar.gz
meson-2961adb8c89fa8ccfbc8e24cd9f1115bd3abeee1.tar.bz2
Compilers: Keep ccache and exelist separated
Only combine them in the Compiler base class, this will make easier to run compiler without ccache.
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py64
1 files changed, 32 insertions, 32 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index c41a7e2..0b78442 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -63,12 +63,12 @@ class CCompiler(CLikeCompiler, Compiler):
language = 'c'
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
# If a child ObjC or CPP class has already set it, don't set it ourselves
- Compiler.__init__(self, exelist, version, for_machine, info,
+ Compiler.__init__(self, ccache, exelist, version, for_machine, info,
is_cross=is_cross, full_version=full_version, linker=linker)
CLikeCompiler.__init__(self, exe_wrapper)
@@ -141,12 +141,12 @@ class _ClangCStds(CompilerMixinBase):
class ClangCCompiler(_ClangCStds, ClangCompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
defines: T.Optional[T.Dict[str, str]] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, linker=linker, full_version=full_version)
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross, info, exe_wrapper, linker=linker, full_version=full_version)
ClangCompiler.__init__(self, defines)
default_warn_args = ['-Wall', '-Winvalid-pch']
self.warn_args = {'0': [],
@@ -205,14 +205,14 @@ class EmscriptenCCompiler(EmscriptenMixin, ClangCCompiler):
id = 'emscripten'
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
defines: T.Optional[T.Dict[str, str]] = None,
full_version: T.Optional[str] = None):
if not is_cross:
raise MesonException('Emscripten compiler can only be used for cross compilation.')
- ClangCCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ ClangCCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper=exe_wrapper, linker=linker,
defines=defines, full_version=full_version)
@@ -222,11 +222,11 @@ class ArmclangCCompiler(ArmclangCompiler, CCompiler):
Keil armclang
'''
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
ArmclangCompiler.__init__(self)
default_warn_args = ['-Wall', '-Winvalid-pch']
@@ -258,12 +258,12 @@ class GnuCCompiler(GnuCompiler, CCompiler):
_C2X_VERSION = '>=9.0.0'
_INVALID_PCH_VERSION = ">=3.4.0"
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
defines: T.Optional[T.Dict[str, str]] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, linker=linker, full_version=full_version)
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross, info, exe_wrapper, linker=linker, full_version=full_version)
GnuCompiler.__init__(self, defines)
default_warn_args = ['-Wall']
if version_compare(self.version, self._INVALID_PCH_VERSION):
@@ -316,11 +316,11 @@ class GnuCCompiler(GnuCompiler, CCompiler):
class PGICCompiler(PGICompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
PGICompiler.__init__(self)
@@ -329,22 +329,22 @@ class NvidiaHPC_CCompiler(PGICompiler, CCompiler):
id = 'nvidia_hpc'
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
PGICompiler.__init__(self)
class ElbrusCCompiler(ElbrusCompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
defines: T.Optional[T.Dict[str, str]] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
ElbrusCompiler.__init__(self)
@@ -377,11 +377,11 @@ class ElbrusCCompiler(ElbrusCompiler, CCompiler):
class IntelCCompiler(IntelGnuLikeCompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
IntelGnuLikeCompiler.__init__(self)
self.lang_header = 'c-header'
@@ -442,12 +442,12 @@ class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompi
_C11_VERSION = '>=19.28'
_C17_VERSION = '>=19.28'
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice,
is_cross: bool, info: 'MachineInfo', target: str,
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker,
full_version=full_version)
MSVCCompiler.__init__(self, target)
@@ -491,7 +491,7 @@ class ClangClCCompiler(_ClangCStds, ClangClCompiler, VisualStudioLikeCCompilerMi
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, [], exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker,
full_version=full_version)
ClangClCompiler.__init__(self, target)
@@ -513,7 +513,7 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, [], exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker,
full_version=full_version)
IntelVisualStudioLikeCompiler.__init__(self, target)
@@ -541,12 +541,12 @@ class IntelLLVMClCCompiler(IntelClCCompiler):
class ArmCCompiler(ArmCompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice,
is_cross: bool, info: 'MachineInfo',
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker,
full_version=full_version)
ArmCompiler.__init__(self)
@@ -567,12 +567,12 @@ class ArmCCompiler(ArmCompiler, CCompiler):
class CcrxCCompiler(CcrxCompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice,
is_cross: bool, info: 'MachineInfo',
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
CcrxCompiler.__init__(self)
@@ -618,12 +618,12 @@ class CcrxCCompiler(CcrxCompiler, CCompiler):
class Xc16CCompiler(Xc16Compiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice,
is_cross: bool, info: 'MachineInfo',
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
Xc16Compiler.__init__(self)
@@ -663,12 +663,12 @@ class Xc16CCompiler(Xc16Compiler, CCompiler):
return ['-I' + path]
class CompCertCCompiler(CompCertCompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice,
is_cross: bool, info: 'MachineInfo',
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
CompCertCompiler.__init__(self)
@@ -696,12 +696,12 @@ class CompCertCCompiler(CompCertCompiler, CCompiler):
return ['-I' + path]
class TICCompiler(TICompiler, CCompiler):
- def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
+ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice,
is_cross: bool, info: 'MachineInfo',
exe_wrapper: T.Optional['ExternalProgram'] = None,
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None):
- CCompiler.__init__(self, exelist, version, for_machine, is_cross,
+ CCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross,
info, exe_wrapper, linker=linker, full_version=full_version)
TICompiler.__init__(self)