From a1542720f43a52f00422913c8caa0556766815e7 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Mon, 20 Sep 2021 10:51:11 -0700 Subject: [PATCH] Record build in BuildTarget.link_depends, not just output of targets. To be able to handle link_depends in backends that do not just operate on a file basis like ninja, information about the targets, not just their output is required. --- mesonbuild/build.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index dd315279c..339bb4350 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -933,8 +933,7 @@ class BuildTarget(Target): self.link_depends.append( File.from_source_file(environment.source_dir, self.subdir, s)) elif hasattr(s, 'get_outputs'): - self.link_depends.extend( - [File.from_built_file(s.get_subdir(), p) for p in s.get_outputs()]) + self.link_depends.append(s) else: raise InvalidArguments( 'Link_depends arguments must be strings, Files, ' @@ -2129,20 +2128,18 @@ class SharedLibrary(BuildTarget): self.vs_module_defs = File.from_absolute_file(path) else: self.vs_module_defs = File.from_source_file(environment.source_dir, self.subdir, path) - self.link_depends.append(self.vs_module_defs) elif isinstance(path, File): # When passing a generated file. self.vs_module_defs = path - self.link_depends.append(path) elif hasattr(path, 'get_filename'): # When passing output of a Custom Target - path = File.from_built_file(path.subdir, path.get_filename()) - self.vs_module_defs = path - self.link_depends.append(path) + self.vs_module_defs = File.from_built_file(path.subdir, path.get_filename()) else: raise InvalidArguments( 'Shared library vs_module_defs must be either a string, ' 'a file object or a Custom Target') + self.process_link_depends(path, environment) + if 'rust_crate_type' in kwargs: rust_crate_type = kwargs['rust_crate_type'] if isinstance(rust_crate_type, str):