This ensures a clear separation between public and private headers. It also makes it clear in Meson and prevents the accidental use of private headers.
Unified · Split
| @@ -2,14 +2,14 @@ EMBEDDING INTO OTHER PROGRAMS (LIBMPV) · 1 unmodified line | ||
| 2 | 2 | ====================================== |
| 3 | 3 | |
| 4 | 4 | mpv can be embedded into other programs as video/audio playback backend. The |
| 5 | −recommended way to do so is using libmpv. See ``mpv/client.h`` in the mpv | |
| 5 | +recommended way to do so is using libmpv. See ``include/mpv/client.h`` in the mpv | |
| 6 | 6 | source code repository. This provides a C API. Bindings for other languages |
| 7 | 7 | might be available (see wiki). |
| 8 | 8 | |
| 9 | 9 | Since libmpv merely allows access to underlying mechanisms that can control |
| 10 | 10 | mpv, further documentation is spread over a few places: |
| 11 | 11 | |
| 12 | −- https://github.com/mpv-player/mpv/blob/master/mpv/client.h | |
| 12 | +- https://github.com/mpv-player/mpv/blob/master/include/mpv/client.h | |
| 13 | 13 | - https://mpv.io/manual/master/#options |
| 14 | 14 | - https://mpv.io/manual/master/#list-of-input-commands |
| 15 | 15 | - https://mpv.io/manual/master/#properties |
| @@ -68,12 +68,12 @@ foreach cmd : ['file', '-config-file', '-input-conf'] · 67 unmodified lines | ||
| 68 | 68 | endforeach |
| 69 | 69 | |
| 70 | 70 | fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c', |
| 71 | − link_language: 'cpp', include_directories: incdir, | |
| 71 | + link_language: 'cpp', include_directories: incdir_public, | |
| 72 | 72 | objects: libmpv.extract_all_objects(recursive: true), |
| 73 | 73 | dependencies: dependencies) |
| 74 | 74 | |
| 75 | 75 | fuzzers += executable('fuzzer_json', 'fuzzer_json.c', |
| 76 | − link_language: 'cpp', include_directories: incdir, | |
| 76 | + link_language: 'cpp', include_directories: [incdir, incdir_public], | |
| 77 | 77 | objects: libmpv.extract_all_objects(recursive: true), |
| 78 | 78 | dependencies: dependencies) |
| 79 | 79 | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -1755,13 +1755,15 @@ if win32 · 1754 unmodified lines | ||
| 1755 | 1755 | endif |
| 1756 | 1756 | |
| 1757 | 1757 | |
| 1758 | +incdir_public = include_directories('./include') | |
| 1758 | 1759 | client_h_define = cc.get_define('MPV_CLIENT_API_VERSION', prefix: '#include "mpv/client.h"', |
| 1759 | − include_directories: include_directories('.')) | |
| 1760 | + include_directories: incdir_public) | |
| 1760 | 1761 | major = client_h_define.split('|')[0].split('<<')[0].strip('() ') |
| 1761 | 1762 | minor = client_h_define.split('|')[1].strip('() ') |
| 1762 | 1763 | client_api_version = major + '.' + minor + '.0' |
| 1763 | 1764 | |
| 1764 | 1765 | libmpv = library('mpv', sources, dependencies: dependencies, gnu_symbol_visibility: 'hidden', |
| 1766 | + include_directories: incdir_public, | |
| 1765 | 1767 | link_args: cc.get_supported_link_arguments(['-Wl,-Bsymbolic']), |
| 1766 | 1768 | version: client_api_version, install: get_option('libmpv'), |
| 1767 | 1769 | build_by_default: get_option('libmpv')) |
| @@ -1772,12 +1774,12 @@ if get_option('libmpv') · 4 unmodified lines | ||
| 1772 | 1774 | pkg.generate(libmpv, version: client_api_version, |
| 1773 | 1775 | description: 'mpv media player client library') |
| 1774 | 1776 | |
| 1775 | − headers = ['mpv/client.h', 'mpv/render.h', | |
| 1776 | − 'mpv/render_gl.h', 'mpv/stream_cb.h'] | |
| 1777 | + headers = ['include/mpv/client.h', 'include/mpv/render.h', | |
| 1778 | + 'include/mpv/render_gl.h', 'include/mpv/stream_cb.h'] | |
| 1777 | 1779 | install_headers(headers, subdir: 'mpv') |
| 1778 | 1780 | |
| 1779 | 1781 | # Allow projects to build with libmpv by cloning into ./subprojects/mpv |
| 1780 | − libmpv_dep = declare_dependency(include_directories: '.', link_with: libmpv) | |
| 1782 | + libmpv_dep = declare_dependency(include_directories: incdir_public, link_with: libmpv) | |
| 1781 | 1783 | meson.override_dependency('mpv', libmpv_dep) |
| 1782 | 1784 | endif |
| 1783 | 1785 | |
| @@ -29,7 +29,7 @@ swift_flags += extra_flags · 28 unmodified lines | ||
| 29 | 29 | swift_compile = [swift_prog, swift_flags, '-module-name', 'swift', |
| 30 | 30 | '-emit-module-path', '@OUTPUT0@', '-import-objc-header', bridge, |
| 31 | 31 | '-emit-objc-header-path', '@OUTPUT1@', '-o', '@OUTPUT2@', |
| 32 | − '@INPUT@', '-I.', '-I' + source_root, | |
| 32 | + '@INPUT@', '-I.', '-I' + source_root, '-I' + source_root / 'include', | |
| 33 | 33 | '-I' + libplacebo.get_variable('includedir', |
| 34 | 34 | default_value: source_root / 'subprojects' / 'libplacebo' / 'src' / 'include'), |
| 35 | 35 | '-I' + libavutil.get_variable('includedir')] |
| @@ -90,7 +90,7 @@ gl_video = executable('gl-video', 'gl_video.c', objects: gl_video_objects, · 89 unmodified lines | ||
| 90 | 90 | link_with: [img_utils, test_utils]) |
| 91 | 91 | test('gl-video', gl_video) |
| 92 | 92 | |
| 93 | −json = executable('json', 'json.c', include_directories: incdir, link_with: test_utils) | |
| 93 | +json = executable('json', 'json.c', include_directories: [incdir, incdir_public], link_with: test_utils) | |
| 94 | 94 | test('json', json) |
| 95 | 95 | |
| 96 | 96 | linked_list = executable('linked-list', files('linked_list.c'), include_directories: incdir) |
| @@ -150,7 +150,7 @@ if get_option('libmpv') · 53 unmodified lines | ||
| 150 | 150 | endif |
| 151 | 151 | if shared |
| 152 | 152 | exe = executable('libmpv-lifetime', sources: 'libmpv_lifetime.c', |
| 153 | − include_directories: incdir) | |
| 153 | + include_directories: incdir_public) | |
| 154 | 154 | test('libmpv-lifetime', exe, depends: mpvlib, suite: 'libmpv') |
| 155 | 155 | endif |
| 156 | 156 | endif |