From 65bd9a2f69e952a6084b2a42d1530d1cad2966ca Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 9 Jan 2016 16:54:30 +0200 Subject: [PATCH] Can use external libs as dependencies of dependencies. Closes #321. --- interpreter.py | 2 +- test cases/linuxlike/1 pkg-config/meson.build | 5 +++++ test cases/linuxlike/2 external library/meson.build | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/interpreter.py b/interpreter.py index 5a8b5e5d4..21cc6cf82 100644 --- a/interpreter.py +++ b/interpreter.py @@ -1123,7 +1123,7 @@ class Interpreter(): d = d.held_object except Exception: pass - if not isinstance(d, (dependencies.Dependency, dependencies.ExternalLibrary)): + if not isinstance(d, (dependencies.Dependency, dependencies.ExternalLibrary, dependencies.InternalDependency)): raise InterpreterException('Dependencies must be external deps') final_deps.append(d) dep = dependencies.InternalDependency(incs, libs, sources, final_deps) diff --git a/test cases/linuxlike/1 pkg-config/meson.build b/test cases/linuxlike/1 pkg-config/meson.build index 8e8e8f256..b7f40db9c 100644 --- a/test cases/linuxlike/1 pkg-config/meson.build +++ b/test cases/linuxlike/1 pkg-config/meson.build @@ -7,6 +7,11 @@ exe = executable('zlibprog', 'prog.c', dependencies : dep) test('zlibtest', exe) +# Test that dependencies of dependencies work. +dep2 = declare_dependency(dependencies : dep) +exe2 = executable('zlibprog2', 'prog.c', dependencies : dep2) +test('zlibtest2', exe2) + # Try to find a nonexistant library to ensure requires:false works. dep = dependency('nvakuhrabnsdfasdf', required : false) diff --git a/test cases/linuxlike/2 external library/meson.build b/test cases/linuxlike/2 external library/meson.build index 3e2c172d0..b20652acc 100644 --- a/test cases/linuxlike/2 external library/meson.build +++ b/test cases/linuxlike/2 external library/meson.build @@ -27,3 +27,8 @@ test('libtest', e) intdep = declare_dependency(dependencies : zlib) exe2 = executable('zprog2', 'prog.c', dependencies : intdep) test('libtest2', exe2) + +# Test that deps that use find_library deps work. +depdep = declare_dependency(dependencies : intdep) +exe3 = executable('zprog3', 'prog.c', dependencies : depdep) +test('libtest3', exe3)