diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-12-10 14:23:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-10 14:23:31 +0200 |
commit | 5ff9e05c8bf05304b80a1c21cbbc11f4d5269ff0 (patch) | |
tree | bcda526499a6cf39ae1fba017b4dd8f9aa073956 /mesonbuild/build.py | |
parent | 2c4e7ebb9b8567ebe198b2d436963dacf667a093 (diff) | |
parent | 664771bb534b007127786e62cb43bac0cb305f93 (diff) | |
download | meson-5ff9e05c8bf05304b80a1c21cbbc11f4d5269ff0.zip meson-5ff9e05c8bf05304b80a1c21cbbc11f4d5269ff0.tar.gz meson-5ff9e05c8bf05304b80a1c21cbbc11f4d5269ff0.tar.bz2 |
Merge pull request #2697 from mesonbuild/custom-target-depends-serialize
custom target: Consider all build depends while serializing
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 8eb95dc..7757300 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1549,6 +1549,24 @@ class CustomTarget(Target): deps.append(c) return deps + def get_transitive_build_target_deps(self): + ''' + Recursively fetch the build targets that this custom target depends on, + whether through `command:`, `depends:`, or `sources:` The recursion is + only performed on custom targets. + This is useful for setting PATH on Windows for finding required DLLs. + F.ex, if you have a python script that loads a C module that links to + other DLLs in your project. + ''' + bdeps = set() + deps = self.get_target_dependencies() + for d in deps: + if isinstance(d, BuildTarget): + bdeps.add(d) + elif isinstance(d, CustomTarget): + bdeps.update(d.get_transitive_build_target_deps()) + return bdeps + def flatten_command(self, cmd): cmd = listify(cmd, unholder=True) final_cmd = [] |