File: meson.build

package info (click to toggle)
celluloid 0.29-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,760 kB
  • sloc: ansic: 18,905; xml: 325; python: 21; makefile: 8
file content (65 lines) | stat: -rw-r--r-- 1,356 bytes parent folder | download
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
project('celluloid', 'c',
  version: '0.29',
  meson_version: '>= 0.49.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_link_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')
subdir('test')

meson.add_install_script('meson-post-install.py')