-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmeson.build
More file actions
96 lines (82 loc) · 2.25 KB
/
Copy pathmeson.build
File metadata and controls
96 lines (82 loc) · 2.25 KB
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
project('clapper-enhancers', 'c',
version: '0.10.0',
meson_version: '>= 0.64.0',
license: 'LGPL-2.1-or-later',
default_options: [
'warning_level=1',
'buildtype=debugoptimized',
],
)
glib_req = '>= 2.76.0'
clapper_req = '>= 0.8.0'
clapper_ver_array = clapper_req.split('=')[-1].strip().split('.')
clapper_api_name = 'clapper-@0@.0'.format(clapper_ver_array[0])
optimization = get_option('optimization')
build_optimized = optimization in ['2', '3', 's']
glib_dep = dependency('glib-2.0',
version: glib_req,
required: false,
)
gobject_dep = dependency('gobject-2.0',
version: glib_req,
required: false,
)
gio_dep = dependency('gio-2.0',
version: glib_req,
required: false,
)
gmodule_dep = dependency('gmodule-2.0',
version: glib_req,
required: false,
)
peas_dep = dependency('libpeas-2',
required: false,
)
clapper_dep = dependency('clapper-0.0',
version: clapper_req,
required: false,
)
# Unless custom dir is set, enhancers dir is determined from libclapper compilation
clapper_enhancers_dir = get_option('enhancersdir').strip()
if clapper_enhancers_dir == ''
clapper_enhancers_dir = clapper_dep.get_variable('enhancersdir')
endif
cc = meson.get_compiler('c')
warning_flags = [
'-Wmissing-declarations',
'-Wredundant-decls',
'-Wwrite-strings',
'-Wformat',
'-Wformat-security',
'-Winit-self',
'-Wmissing-include-dirs',
'-Waddress',
'-Wno-multichar',
'-Wvla',
'-Wpointer-arith',
'-Wmissing-prototypes',
'-Wdeclaration-after-statement',
'-Wold-style-definition',
'-Wsign-compare',
]
foreach extra_arg : warning_flags
if cc.has_argument (extra_arg)
add_project_arguments([extra_arg], language: 'c')
endif
endforeach
if build_optimized
message('Disabling GLib cast checks')
add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c')
message('Disabling GLib asserts')
add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
message('Disabling GLib checks')
add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
endif
subdir('src')
summary({
'enhancers-dir': clapper_enhancers_dir,
'optimization': optimization,
}, section: 'Directories')
foreach name : clapper_possible_enhancers
summary(name, clapper_available_enhancers.contains(name) ? 'Yes' : 'No', section: 'Enhancers')
endforeach