diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-01-04 14:21:39 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-01-06 19:20:32 +0200 |
commit | fd66692f73efb80783172b9d346ae4a5b6b6fa6d (patch) | |
tree | 9c60282227f18eab18e48b453b34a5b875dc080c | |
parent | 86feb843f4c196b366ec317c5212d404df34191e (diff) | |
download | meson-fd66692f73efb80783172b9d346ae4a5b6b6fa6d.tar.gz |
Fix a problem when anyone actually tries to use a non-found dependency
Fix BuildTarget.add_deps() to handle class Dependency
Extend test case to cover uses of the not-found dependency object
-rw-r--r-- | mesonbuild/build.py | 2 | ||||
-rw-r--r-- | test cases/common/171 not-found dependency/meson.build | 5 | ||||
-rw-r--r-- | test cases/common/171 not-found dependency/sub/meson.build | 1 | ||||
-rw-r--r-- | test cases/common/171 not-found dependency/testlib.c | 0 |
4 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 4a35bec31..8a2e716aa 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -839,7 +839,7 @@ This will become a hard error in a future Meson release.''') self.external_deps.append(extpart) # Deps of deps. self.add_deps(dep.ext_deps) - elif isinstance(dep, dependencies.ExternalDependency): + elif isinstance(dep, dependencies.Dependency): self.external_deps.append(dep) self.process_sourcelist(dep.get_sources()) elif isinstance(dep, BuildTarget): diff --git a/test cases/common/171 not-found dependency/meson.build b/test cases/common/171 not-found dependency/meson.build index 7d92f5ae6..85505eec1 100644 --- a/test cases/common/171 not-found dependency/meson.build +++ b/test cases/common/171 not-found dependency/meson.build @@ -1,4 +1,4 @@ -project('dep-test') +project('dep-test', 'c') dep = dependency('', required:false) if dep.found() @@ -6,3 +6,6 @@ if dep.found() endif assert(dep.type_name() == 'not-found', 'dependency should be of type "not-found" not ' + dep.type_name()) + +library('testlib', 'testlib.c', dependencies: [dep]) +subdir('sub', if_found: dep) diff --git a/test cases/common/171 not-found dependency/sub/meson.build b/test cases/common/171 not-found dependency/sub/meson.build new file mode 100644 index 000000000..2a33cae06 --- /dev/null +++ b/test cases/common/171 not-found dependency/sub/meson.build @@ -0,0 +1 @@ +error('should be disabled by subdir(if_found:)') diff --git a/test cases/common/171 not-found dependency/testlib.c b/test cases/common/171 not-found dependency/testlib.c new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test cases/common/171 not-found dependency/testlib.c |