-
Notifications
You must be signed in to change notification settings - Fork 13
/
meson.build
111 lines (93 loc) · 2.65 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
project('BestSource', 'cpp',
default_options: ['buildtype=release', 'b_ndebug=if-release', 'cpp_std=c++17'],
license: 'MIT',
meson_version: '>=0.53.0',
version: '9.0',
)
api_sources = files(
'src/audiosource.cpp',
'src/bsshared.cpp',
'src/tracklist.cpp',
'src/videosource.cpp',
)
api_headers = files(
'src/audiosource.h',
'src/bsshared.h',
'src/tracklist.h',
'src/version.h',
'src/videosource.h',
)
plugin_sources = files(
'src/avisynth.cpp',
'src/synthshared.cpp',
'src/vapoursynth.cpp',
)
libs = []
p2p_args = []
if host_machine.cpu_family().startswith('x86')
p2p_args += ['-DP2P_SIMD']
endif
libs += static_library('p2p_main',
files(
'libp2p/p2p_api.cpp',
'libp2p/v210.cpp',
'libp2p/simd/cpuinfo_x86.cpp',
'libp2p/simd/p2p_simd.cpp',
),
cpp_args: p2p_args,
gnu_symbol_visibility: 'hidden',
)
if host_machine.cpu_family().startswith('x86')
p2p_args += ['-msse4.1']
libs += static_library('p2p_sse41', files('libp2p/simd/p2p_sse41.cpp'),
cpp_args: p2p_args,
gnu_symbol_visibility: 'hidden',
)
endif
deps = [
dependency('libavcodec', version: '>=61.19.0'),
dependency('libavformat', version: '>=61.7.0'),
dependency('libavutil', version: '>=59.39.0'),
dependency('libxxhash'),
]
link_args = []
if meson.get_compiler('cpp').get_linker_id() in ['ld.bfd', 'ld.gold', 'ld.mold']
link_args += ['-Wl,-Bsymbolic']
endif
libbestsource = library('libbestsource', api_sources,
dependencies: deps,
install: true,
link_args: link_args,
link_with: libs,
name_prefix: '',
)
install_headers(api_headers,
subdir: 'bestsource',
)
pkg = import('pkgconfig')
pkg.generate(libbestsource,
description: 'A super great audio/video source and FFmpeg wrapper',
filebase: 'bestsource',
name: 'bestsource',
subdirs: 'bestsource',
)
bestsource_dep = declare_dependency(
include_directories: include_directories('src'),
link_with: libbestsource,
)
if get_option('enable_plugin')
vapoursynth_dep = dependency('vapoursynth', version: '>=55').partial_dependency(compile_args: true, includes: true)
install_rpath = ''
if get_option('default_library') != 'static'
install_rpath = get_option('prefix') / get_option('libdir')
endif
shared_module('bestsource', plugin_sources,
dependencies: [bestsource_dep, vapoursynth_dep],
gnu_symbol_visibility: 'hidden',
install: true,
install_dir: vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth',
install_rpath: install_rpath,
link_args: link_args,
name_prefix: '',
)
endif