forked from HandBrake/HandBrake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
143 lines (124 loc) · 4.06 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Copyright (C) 2023-2024 HandBrake Team
# SPDX-License-Identifier: GPL-2.0-or-later
project('handbrake-gtk', 'c', 'cpp',
version: run_command('data/version.py', check: true).stdout().strip(),
license: 'GPL-2.0-only',
meson_version: '>= 0.51.0',
default_options: ['warning_level=1', 'buildtype=release'])
# Minimum versions for dependencies
glib_min = '>= 2.56'
gtk_min = '>= 3.22'
gst_min = '>= 1.10'
cc = meson.get_compiler('c')
i18n = import('i18n')
gnome = import('gnome')
hb_dir = get_option('hb-dir')
if hb_dir == ''
hb_dir = meson.current_build_dir() / '..'
endif
hb_libdirs = [hb_dir / 'libhb', hb_dir / 'contrib/lib'] + get_option('extra-libdirs')
hb_incdirs = include_directories(hb_dir / 'libhb', hb_dir / 'contrib/include')
# External dependencies (required)
ghb_deps = [
cc.find_library('handbrake', dirs: hb_libdirs),
cc.find_library('bz2', dirs: hb_libdirs),
cc.find_library('m', required: false),
cc.find_library('mp3lame', dirs: hb_libdirs),
dependency('dvdnav'),
dependency('dvdread'),
dependency('dav1d'),
dependency('SvtAv1Enc'),
dependency('fribidi'),
dependency('glib-2.0', version: glib_min),
dependency('gio-2.0', version: glib_min),
dependency('gthread-2.0', version: glib_min),
dependency('gmodule-2.0', version: glib_min),
dependency('gtk+-3.0', version: gtk_min),
dependency('jansson'),
dependency('libass'),
dependency('libavcodec'),
dependency('libavfilter'),
dependency('libavformat'),
dependency('libavutil'),
dependency('libbluray'),
dependency('liblzma'),
dependency('libpostproc'),
dependency('libswresample'),
dependency('libswscale'),
dependency('libxml-2.0'),
dependency('ogg'),
dependency('opus'),
dependency('speex'),
dependency('theoradec'),
dependency('theoraenc'),
dependency('threads'),
dependency('libturbojpeg'),
dependency('vorbis'),
dependency('vorbisenc'),
dependency('vpx'),
dependency('x264'),
dependency('zimg'),
dependency('zlib'),
]
if get_option('gstreamer').enabled()
gst = dependency('gstreamer-1.0', version: gst_min, required: false)
gst_audio = dependency('gstreamer-audio-1.0', required: false)
gst_video = dependency('gstreamer-video-1.0', required: false)
gst_pbutils = dependency('gstreamer-pbutils-1.0', required: false)
if gst_pbutils.found()
ghb_deps += [gst, gst_audio, gst_video, gst_pbutils]
add_project_arguments('-D_ENABLE_GST', language: 'c')
else
message('Preview support disabled as gstreamer-plugins-base was not found.')
endif
endif
if get_option('libdovi').enabled()
ghb_deps += dependency('dovi')
endif
if get_option('fdk-aac').enabled()
ghb_deps += dependency('fdk-aac')
endif
if get_option('qsv').enabled()
if host_machine.system() == 'windows'
ghb_deps += cc.find_library('vpl', dirs: hb_libdirs)
else
ghb_deps += [dependency('vpl'), dependency('libva'), dependency('libva-drm')]
endif
endif
if get_option('x265').enabled()
ghb_deps += dependency('x265')
if get_option('numa').enabled()
numa = dependency('numa', required: false)
if not numa.found()
numa = cc.find_library('numa')
endif
ghb_deps += numa
endif
endif
if get_option('mf').enabled()
ghb_deps += [cc.find_library('mfplat'), cc.find_library('strmiids')]
endif
# OS-specific dependencies
if host_machine.system() == 'windows'
add_project_link_arguments('-mwindows', language: ['c', 'cpp'])
win_dlls = ['bcrypt', 'ntdll', 'ole32', 'regex', 'userenv', 'uuid', 'ws2_32']
foreach dll: win_dlls
ghb_deps += cc.find_library(dll)
endforeach
elif not cc.has_function('dlopen')
ghb_deps += cc.find_library('dl')
endif
if not cc.has_function('iconv')
ghb_deps += cc.find_library('iconv', dirs: get_option('extra-libdirs'))
add_project_arguments('-DLIBICONV_PLUG', language: ['c', 'cpp'])
endif
if not get_option('c_std').contains('gnu')
add_project_arguments('-D_DEFAULT_SOURCE', language: ['c', 'cpp'])
endif
link_args = cc.get_supported_link_arguments(
'-Wl,--export-dynamic', '-Wl,--exclude-libs,ALL')
add_project_link_arguments(link_args, language: ['c', 'cpp'])
subdir('po')
subdir('icons')
subdir('data')
subdir('src')