diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-01-04 14:21:39 +0000 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-02-19 01:32:16 +0530 |
commit | 0e2577faf8da93d56a80cadc270ace5af8d72852 (patch) | |
tree | 243ec63010b46db6032912aa189619e65497f7b1 | |
parent | 2698aef0f5ca131797ab896867e3bc41488a0d9b (diff) | |
download | meson-0e2577faf8da93d56a80cadc270ace5af8d72852.zip meson-0e2577faf8da93d56a80cadc270ace5af8d72852.tar.gz meson-0e2577faf8da93d56a80cadc270ace5af8d72852.tar.bz2 |
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 4a35bec..8a2e716 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 7d92f5a..85505ee 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 0000000..2a33cae --- /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 0000000..e69de29 --- /dev/null +++ b/test cases/common/171 not-found dependency/testlib.c |