aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-10-14 16:29:28 -0400
committerXavier Claessens <xclaesse@gmail.com>2022-10-24 14:52:13 +0200
commite04bce3f0453fc73c2170cfbf2f51debe2fc33c3 (patch)
treed1c80b10234e1ffcf528345181b448d7d1da6132
parentc8aecc7685c10bf961327b5f1bef9e7da6c47e01 (diff)
downloadmeson-e04bce3f0453fc73c2170cfbf2f51debe2fc33c3.zip
meson-e04bce3f0453fc73c2170cfbf2f51debe2fc33c3.tar.gz
meson-e04bce3f0453fc73c2170cfbf2f51debe2fc33c3.tar.bz2
Not all compilers support depfile
-rw-r--r--mesonbuild/backend/ninjabackend.py3
-rw-r--r--mesonbuild/compilers/compilers.py2
-rw-r--r--mesonbuild/compilers/swift.py2
3 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 7d90ac1..bbaeef3 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.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)
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 147ca46..d54d06d 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -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:
diff --git a/mesonbuild/compilers/swift.py b/mesonbuild/compilers/swift.py
index 6d434ae..998e5df 100644
--- a/mesonbuild/compilers/swift.py
+++ b/mesonbuild/compilers/swift.py
@@ -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: