Not all compilers support depfile

pull/10909/head
Xavier Claessens 2 years ago committed by Xavier Claessens
parent c8aecc7685
commit e04bce3f04
  1. 3
      mesonbuild/backend/ninjabackend.py
  2. 2
      mesonbuild/compilers/compilers.py
  3. 2
      mesonbuild/compilers/swift.py

@ -2824,7 +2824,8 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
element.add_dep(pch_dep)
for i in self.get_fortran_orderdeps(target, compiler):
element.add_orderdep(i)
element.add_item('DEPFILE', dep_file)
if dep_file:
element.add_item('DEPFILE', dep_file)
element.add_item('ARGS', commands)
self.add_dependency_scanner_entries_to_element(target, compiler, element, src)

@ -1147,7 +1147,7 @@ class Compiler(HoldableObject, 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:
def depfile_for_object(self, objfile: str) -> T.Optional[str]:
return objfile + '.' + self.get_depfile_suffix()
def get_depfile_suffix(self) -> str:

@ -59,7 +59,7 @@ class SwiftCompiler(Compiler):
def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]:
return ['-emit-dependencies']
def depfile_for_object(self, objfile: str) -> str:
def depfile_for_object(self, objfile: str) -> T.Optional[str]:
return os.path.splitext(objfile)[0] + '.' + self.get_depfile_suffix()
def get_depfile_suffix(self) -> str:

Loading…
Cancel
Save