aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2021-09-20 10:51:11 -0700
committerEli Schwartz <eschwartz93@gmail.com>2021-10-04 22:34:57 -0400
commita1542720f43a52f00422913c8caa0556766815e7 (patch)
treebc5384b3d3681bdda878699748fb00d4ff7eec5e /mesonbuild/build.py
parent246d5f34bbef7f179589c52ccd7d435f57108272 (diff)
downloadmeson-a1542720f43a52f00422913c8caa0556766815e7.zip
meson-a1542720f43a52f00422913c8caa0556766815e7.tar.gz
meson-a1542720f43a52f00422913c8caa0556766815e7.tar.bz2
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.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index dd31527..339bb43 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):