diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-05-21 23:47:23 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-05-21 23:47:23 +0300 |
commit | ee0607ddf92b0d4e3cf9a075db6c2e2f4439400e (patch) | |
tree | 5776d8b7c254c7b78c5d0e556ee2f6720e2c3b84 /build.py | |
parent | 2ecd2ea65a3c3a81e83d298ed815984b4107b9da (diff) | |
download | meson-ee0607ddf92b0d4e3cf9a075db6c2e2f4439400e.zip meson-ee0607ddf92b0d4e3cf9a075db6c2e2f4439400e.tar.gz meson-ee0607ddf92b0d4e3cf9a075db6c2e2f4439400e.tar.bz2 |
Can use outputs of targets as inputs of custom targets.
Diffstat (limited to 'build.py')
-rw-r--r-- | build.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -203,7 +203,7 @@ class BuildTarget(): for i in self.link_targets: result += i.get_rpaths() return result - + def get_custom_install_dir(self): return self.custom_install_dir @@ -567,6 +567,7 @@ class CustomTarget: def __init__(self, name, subdir, kwargs): self.name = name self.subdir = subdir + self.dependencies = [] self.process_kwargs(kwargs) def process_kwargs(self, kwargs): @@ -586,10 +587,15 @@ class CustomTarget: for i, c in enumerate(cmd): if hasattr(c, 'ep'): c = c.ep + if hasattr(c, 'held_object'): + c = c.held_object if isinstance(c, str): final_cmd.append(c) elif isinstance(c, dependencies.ExternalProgram): final_cmd.append(c.get_command()) + elif isinstance(c, BuildTarget) or isinstance(c, CustomTarget): + self.dependencies.append(c) + final_cmd.append(os.path.join(c.get_subdir(), c.get_filename())) else: raise InvalidArguments('Argument %s in "command" is invalid.' % i) self.command = final_cmd @@ -609,14 +615,14 @@ class CustomTarget: return self.name def get_dependencies(self): - return [] + return self.dependencies def should_install(self): return self.install def get_custom_install_dir(self): return self.install_dir - + def get_subdir(self): return self.subdir |