History

include: move public headers to own directory

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.

Kacper Michajłow committed 1 year ago

Commit f1e1a0b1 parent d759e269 files · +13 −11Browse files

Unified · Split

9 files
  1. DOCS/man/libmpv.rst +2 −2
  2. fuzzers/meson.build +2 −2
  3. include/mpv/client.h +0 −0
  4. include/mpv/render.h +0 −0
  5. include/mpv/render_gl.h +0 −0
  6. include/mpv/stream_cb.h +0 −0
  7. meson.build +6 −4
  8. osdep/mac/meson.build +1 −1
  9. test/meson.build +2 −2
DOCS/man/libmpv.rst+2−2
@@ -2,14 +2,14 @@ EMBEDDING INTO OTHER PROGRAMS (LIBMPV) · 1 unmodified line
22 ======================================
33
44 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
66 source code repository. This provides a C API. Bindings for other languages
77 might be available (see wiki).
88
99 Since libmpv merely allows access to underlying mechanisms that can control
1010 mpv, further documentation is spread over a few places:
1111
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
1313 - https://mpv.io/manual/master/#options
1414 - https://mpv.io/manual/master/#list-of-input-commands
1515 - https://mpv.io/manual/master/#properties
fuzzers/meson.build+2−2
@@ -68,12 +68,12 @@ foreach cmd : ['file', '-config-file', '-input-conf'] · 67 unmodified lines
6868 endforeach
6969
7070 fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c',
71− link_language: 'cpp', include_directories: incdir,
71+ link_language: 'cpp', include_directories: incdir_public,
7272 objects: libmpv.extract_all_objects(recursive: true),
7373 dependencies: dependencies)
7474
7575 fuzzers += executable('fuzzer_json', 'fuzzer_json.c',
76− link_language: 'cpp', include_directories: incdir,
76+ link_language: 'cpp', include_directories: [incdir, incdir_public],
7777 objects: libmpv.extract_all_objects(recursive: true),
7878 dependencies: dependencies)
7979
include/mpv/client.hrenamed from mpv/client.h+0−0

File renamed without changes.

include/mpv/render.hrenamed from mpv/render.h+0−0

File renamed without changes.

include/mpv/render_gl.hrenamed from mpv/render_gl.h+0−0

File renamed without changes.

include/mpv/stream_cb.hrenamed from mpv/stream_cb.h+0−0

File renamed without changes.

meson.build+6−4
@@ -1755,13 +1755,15 @@ if win32 · 1754 unmodified lines
17551755 endif
17561756
17571757
1758+incdir_public = include_directories('./include')
17581759 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)
17601761 major = client_h_define.split('|')[0].split('<<')[0].strip('() ')
17611762 minor = client_h_define.split('|')[1].strip('() ')
17621763 client_api_version = major + '.' + minor + '.0'
17631764
17641765 libmpv = library('mpv', sources, dependencies: dependencies, gnu_symbol_visibility: 'hidden',
1766+ include_directories: incdir_public,
17651767 link_args: cc.get_supported_link_arguments(['-Wl,-Bsymbolic']),
17661768 version: client_api_version, install: get_option('libmpv'),
17671769 build_by_default: get_option('libmpv'))
@@ -1772,12 +1774,12 @@ if get_option('libmpv') · 4 unmodified lines
17721774 pkg.generate(libmpv, version: client_api_version,
17731775 description: 'mpv media player client library')
17741776
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']
17771779 install_headers(headers, subdir: 'mpv')
17781780
17791781 # 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)
17811783 meson.override_dependency('mpv', libmpv_dep)
17821784 endif
17831785
osdep/mac/meson.build+1−1
@@ -29,7 +29,7 @@ swift_flags += extra_flags · 28 unmodified lines
2929 swift_compile = [swift_prog, swift_flags, '-module-name', 'swift',
3030 '-emit-module-path', '@OUTPUT0@', '-import-objc-header', bridge,
3131 '-emit-objc-header-path', '@OUTPUT1@', '-o', '@OUTPUT2@',
32− '@INPUT@', '-I.', '-I' + source_root,
32+ '@INPUT@', '-I.', '-I' + source_root, '-I' + source_root / 'include',
3333 '-I' + libplacebo.get_variable('includedir',
3434 default_value: source_root / 'subprojects' / 'libplacebo' / 'src' / 'include'),
3535 '-I' + libavutil.get_variable('includedir')]
test/meson.build+2−2
@@ -90,7 +90,7 @@ gl_video = executable('gl-video', 'gl_video.c', objects: gl_video_objects, · 89 unmodified lines
9090 link_with: [img_utils, test_utils])
9191 test('gl-video', gl_video)
9292
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)
9494 test('json', json)
9595
9696 linked_list = executable('linked-list', files('linked_list.c'), include_directories: incdir)
@@ -150,7 +150,7 @@ if get_option('libmpv') · 53 unmodified lines
150150 endif
151151 if shared
152152 exe = executable('libmpv-lifetime', sources: 'libmpv_lifetime.c',
153− include_directories: incdir)
153+ include_directories: incdir_public)
154154 test('libmpv-lifetime', exe, depends: mpvlib, suite: 'libmpv')
155155 endif
156156 endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t