forked from HandBrake/HandBrake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
142 lines (121 loc) · 3.7 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
# 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=2', 'buildtype=release'])
# Minimum versions for dependencies
glib_min = '>= 2.68'
gtk_min = '>= 4.4'
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_incdirs = include_directories(hb_dir / 'libhb', hb_dir / 'contrib/include')
# External dependencies (required)
ghb_deps = [
cc.find_library('handbrake', dirs: hb_dir / 'libhb'),
dependency('dvdnav'),
dependency('dvdread'),
dependency('SvtAv1Enc'),
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('gtk4', version: gtk_min),
dependency('jansson'),
dependency('libass'),
dependency('libavcodec'),
dependency('libavfilter'),
dependency('libavformat'),
dependency('libavutil'),
dependency('libbluray'),
dependency('libswresample'),
dependency('libswscale'),
dependency('libturbojpeg'),
dependency('libxml-2.0'),
dependency('ogg'),
dependency('theoradec'),
dependency('theoraenc'),
dependency('threads'),
dependency('vorbis'),
dependency('vorbisenc'),
dependency('x264'),
]
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()
ghb_deps += dependency('vpl')
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')
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
if (cc.has_function('strerror_r'))
add_project_arguments('-DHAS_STRERROR_R', language: 'c')
endif
add_project_arguments('-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_4',
'-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_4', language: 'c')
compile_args = cc.get_supported_arguments(
'-Wno-missing-field-initializers',
'-Wno-sign-compare',
'-Wno-unused-parameter',
'-Wignored-qualifiers',
'-Wimplicit-function-declaration',
'-Wincompatible-pointer-types',
'-Wint-conversion',
'-Wint-to-pointer-cast',
'-Wlogical-op',
'-Wmissing-format-attribute',
'-Wmissing-noreturn',
'-Wmissing-include-dirs',
'-Wnested-externs',
'-Wold-style-definition',
'-Woverflow',
'-Wpointer-to-int-cast',
'-Wshadow',
'-Wstrict-prototypes',
'-Wunused',
'-Wwrite-strings')
add_project_arguments(compile_args, language: 'c')
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')