aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-01-09 16:54:30 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-01-10 22:34:34 +0200
commit65bd9a2f69e952a6084b2a42d1530d1cad2966ca (patch)
tree830a597343e1fa94de667954e55c8620a8ca48df
parente374b53788ff27f1fa19da77e60ea39dacec706c (diff)
downloadmeson-65bd9a2f69e952a6084b2a42d1530d1cad2966ca.zip
meson-65bd9a2f69e952a6084b2a42d1530d1cad2966ca.tar.gz
meson-65bd9a2f69e952a6084b2a42d1530d1cad2966ca.tar.bz2
Can use external libs as dependencies of dependencies. Closes #321.
-rw-r--r--interpreter.py2
-rw-r--r--test cases/linuxlike/1 pkg-config/meson.build5
-rw-r--r--test cases/linuxlike/2 external library/meson.build5
3 files changed, 11 insertions, 1 deletions
diff --git a/interpreter.py b/interpreter.py
index 5a8b5e5..21cc6cf 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 8e8e8f2..b7f40db 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 3e2c172..b20652a 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)