-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
84 lines (74 loc) · 1.54 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
project(
'multiwatch',
'c',
default_options: [
'buildtype=debugoptimized',
'warning_level=3',
'c_std=gnu99',
],
version: '1.0.1',
license: 'BSD-3-Clause',
)
compiler = meson.get_compiler('c')
conf_data = configuration_data()
conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
conf_data.set_quoted('PACKAGE_NAME', meson.project_name())
dep_glib = dependency('glib-2.0', version: '>=2.16')
# find libev manually
dep_ev = compiler.find_library(
'ev',
has_headers: 'ev.h',
)
if not compiler.has_function(
'ev_time',
prefix: '#include <ev.h>',
dependencies: dep_ev,
)
error('Missing ev_time() in libev')
endif
warn_c_args = [
'-Wshadow',
'-W',
'-pedantic',
]
if get_option('extra-warnings')
warn_c_args += [
'-Wmissing-declarations',
'-Wdeclaration-after-statement',
'-Wcast-align',
'-Wsign-compare',
'-Wnested-externs',
'-Wpointer-arith',
'-Wmissing-prototypes',
'-Wno-pointer-sign',
'-Wformat',
'-Wformat-security',
'-D_FORTIFY_SOURCE=2',
'-fstack-protector',
'--param=ssp-buffer-size=4',
]
endif
add_project_arguments(
compiler.get_supported_arguments(warn_c_args),
language: 'c'
)
configure_file(output: 'config.h', configuration: conf_data)
add_global_arguments('-DHAVE_CONFIG_H', language : 'c')
bin_worker = executable(
'multiwatch',
'multiwatch.c',
install: true,
dependencies: [
dep_glib,
dep_ev,
],
)
install_man(
'multiwatch.1',
)
summary(
{
'Extra warnings': get_option('extra-warnings')
},
section: 'Features',
)