meson: declare libmpv as a dependency and override it

This allows libmpv users to build it as a subproject easily, i.e. meson
setup build --force-fallback-for=mpv -Dmpv:libmpv=true, if the mpv
source is in the subprojects directory. Mainly useful for development.
This commit is contained in:
Dudemanguy 2023-10-02 11:36:20 -05:00
parent 01c5346d1a
commit ace4d252e5
1 changed files with 4 additions and 0 deletions

View File

@ -1740,6 +1740,10 @@ if get_option('libmpv')
headers = ['libmpv/client.h', 'libmpv/render.h', headers = ['libmpv/client.h', 'libmpv/render.h',
'libmpv/render_gl.h', 'libmpv/stream_cb.h'] 'libmpv/render_gl.h', 'libmpv/stream_cb.h']
install_headers(headers, subdir: 'mpv') install_headers(headers, subdir: 'mpv')
# Allow projects to build with libmpv by cloning into ./subprojects/mpv
libmpv_dep = declare_dependency(link_with: libmpv)
meson.override_dependency('mpv', libmpv_dep)
endif endif
if get_option('cplayer') if get_option('cplayer')