compilres: move depfile_for_object to compiler

pull/7795/head
Dylan Baker 4 years ago
parent 413f4d87e9
commit 224a752489
  1. 5
      mesonbuild/compilers/compilers.py
  2. 5
      mesonbuild/compilers/cuda.py
  3. 6
      mesonbuild/compilers/d.py
  4. 3
      mesonbuild/compilers/mixins/clike.py

@ -1072,6 +1072,11 @@ class Compiler(metaclass=abc.ABCMeta):
def get_include_args(self, path: str, is_system: bool) -> T.List[str]:
return []
def depfile_for_object(self, objfile: str) -> str:
return objfile + '.' + self.get_depfile_suffix()
def get_depfile_suffix(self) -> str:
raise EnvironmentError('{} does not implement get_depfile_suffix'.format(self.id))
def get_args_from_envvars(lang: str,

@ -251,10 +251,7 @@ class CudaCompiler(Compiler):
def get_link_debugfile_args(self, targetfile):
return self._cook_link_args(self.host_compiler.get_link_debugfile_args(targetfile))
def depfile_for_object(self, objfile):
return objfile + '.' + self.get_depfile_suffix()
def get_depfile_suffix(self):
def get_depfile_suffix(self) -> str:
return 'd'
def get_buildtype_linker_args(self, buildtype):

@ -111,9 +111,6 @@ class DmdLikeCompilerMixin:
def get_compile_only_args(self):
return ['-c']
def depfile_for_object(self, objfile):
return objfile + '.' + self.get_depfile_suffix()
def get_depfile_suffix(self):
return 'deps'
@ -469,9 +466,6 @@ class DCompiler(Compiler):
def needs_static_linker(self):
return True
def depfile_for_object(self, objfile):
return objfile + '.' + self.get_depfile_suffix()
def get_depfile_suffix(self):
return 'deps'

@ -169,9 +169,6 @@ class CLikeCompiler(Compiler):
# Almost every compiler uses this for disabling warnings
return ['-w']
def depfile_for_object(self, objfile: str) -> str:
return objfile + '.' + self.get_depfile_suffix()
def get_depfile_suffix(self) -> str:
return 'd'

Loading…
Cancel
Save