aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index b5f46df..58fd5c6 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2513,15 +2513,18 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
element.add_item('DEPFILE', dep_file)
element.add_item('ARGS', commands)
- self.add_dependency_scanner_entries_to_element(target, compiler, element)
+ self.add_dependency_scanner_entries_to_element(target, compiler, element, src)
self.add_build(element)
assert(isinstance(rel_obj, str))
assert(isinstance(rel_src, str))
return (rel_obj, rel_src.replace('\\', '/'))
- def add_dependency_scanner_entries_to_element(self, target, compiler, element):
+ def add_dependency_scanner_entries_to_element(self, target, compiler, element, src):
if not self.should_use_dyndeps_for_target(target):
return
+ extension = os.path.splitext(src.fname)[1][1:]
+ if not (extension in compilers.lang_suffixes['fortran'] or extension in compilers.lang_suffixes['cpp']):
+ return
dep_scan_file = self.get_dep_scan_file_for(target)
element.add_item('dyndep', dep_scan_file)
element.add_orderdep(dep_scan_file)