build: Allow valadoc to find libhandy vapi when built from a subproject

This commit is contained in:
Michael Gratton 2020-08-16 17:27:19 +10:00 committed by Michael James Gratton
parent 5b097c3076
commit a043eec310
2 changed files with 11 additions and 2 deletions

View file

@ -118,6 +118,7 @@ if libunwind_dep.found()
endif
# Handy 1.0 is still rather new
libhandy_vapi = ''
if not libhandy.found()
libhandy_project = subproject(
'libhandy',
@ -130,9 +131,10 @@ if not libhandy.found()
libhandy = declare_dependency(
dependencies: [
libhandy_project.get_variable('libhandy_dep'),
libhandy_project.get_variable('libhandy_vapi'),
libhandy_project.get_variable('libhandy_vapi')
]
)
libhandy_vapi = meson.build_root() / 'subprojects' / 'libhandy' / 'src'
endif
# Optional dependencies

View file

@ -138,7 +138,11 @@ valadoc_dependencies = [
valadoc_dep_args = []
foreach dep : valadoc_dependencies
valadoc_dep_args += '--pkg'
valadoc_dep_args += dep.name()
if dep != libhandy
valadoc_dep_args += dep.name()
else
valadoc_dep_args += 'libhandy-1'
endif
endforeach
valadoc_dep_args += [ '--pkg', 'posix' ]
@ -146,6 +150,9 @@ valadoc_vapi_dirs = [
vapi_dir,
meson.current_build_dir()
]
if libhandy_vapi != ''
valadoc_vapi_dirs += libhandy_vapi
endif
valadoc_vapidir_args = []
foreach dir : valadoc_vapi_dirs