Can use external libs as dependencies of dependencies. Closes #321.

pull/351/head
Jussi Pakkanen 9 years ago
parent e374b53788
commit 65bd9a2f69
  1. 2
      interpreter.py
  2. 5
      test cases/linuxlike/1 pkg-config/meson.build
  3. 5
      test cases/linuxlike/2 external library/meson.build

@ -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)

@ -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)

@ -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)

Loading…
Cancel
Save