forked from celluloid-player/celluloid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
64 lines (58 loc) · 1.3 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
project('gnome-mpv', 'c',
version: '0.12',
meson_version: '>= 0.37.0',
default_options: [
'warning_level=2',
'c_std=gnu99',
]
)
i18n = import('i18n')
cc = meson.get_compiler('c')
test_cflags = [
'-funsigned-char',
'-fstack-protector-strong',
'-fPIE',
'-fPIC',
'-Wconversion',
'-Winline',
'-Wno-padded',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
'-Wmissing-prototypes',
'-Werror=implicit-function-declaration',
'-Werror=pointer-arith',
'-Werror=init-self',
['-Werror=format-security', '-Werror=format=2'], # Must be checked together
'-Werror=missing-include-dirs',
'-Werror=date-time'
]
global_cflags = []
foreach cflag : test_cflags
if cc.has_multi_arguments(cflag)
global_cflags += cflag
endif
endforeach
if cc.has_header('execinfo.h')
global_cflags += '-DHAVE_EXECINFO_H'
endif
add_project_arguments(global_cflags, language: 'c')
test_ldflags = [
'-pie',
'-Wl,-z,relro',
'-Wl,-z,now'
]
global_ldflags = []
foreach ldflag : test_ldflags
if cc.has_argument(ldflag)
global_ldflags += ldflag
endif
endforeach
add_project_link_arguments(global_ldflags, language: 'c')
if not cc.has_function('setlocale')
error('Could not find setlocale()')
endif
subdir('src')
subdir('data')
subdir('docs')
subdir('po')
meson.add_install_script('meson_post_install.py')