-
Notifications
You must be signed in to change notification settings - Fork 3
/
meson.build
107 lines (95 loc) · 3.43 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
project('eos-event-recorder-daemon',
'c',
license: 'GPL-2.0-or-later',
version: '0.0.0',
default_options: ['c_std=c11', 'warning_level=2'],
meson_version: '>= 0.55',
)
cc = meson.get_compiler('c')
glib_major_version = '2'
glib_minor_version = '74'
glib_dep_version = '>= @0@.@1@'.format(glib_major_version, glib_minor_version)
glib_version_define = 'GLIB_VERSION_@0@_@1@'.format(glib_major_version, glib_minor_version)
glib_dep = dependency('glib-2.0', version: glib_dep_version)
eosmetrics_dep = dependency('eosmetrics-0', version: '>= 0.2')
polkit_gobject_dep = dependency('polkit-gobject-1')
emer_shared_required_modules = [
glib_dep,
dependency('gio-unix-2.0', version: glib_dep_version),
dependency('gobject-2.0', version: glib_dep_version),
dependency('sqlite3'),
dependency('uuid'),
]
emer_required_modules = emer_shared_required_modules + [
eosmetrics_dep,
cc.find_library('m', required: false),
dependency('ostree-1', version: '>= 2013.7'),
polkit_gobject_dep,
dependency('libsoup-3.0'),
]
gnome = import('gnome')
py = import('python').find_installation('python3',
modules: [
# Meson can't express dbusmock >= 0.10 here
'dbusmock',
'dbus',
],
)
systemd_dep = dependency('systemd')
event_recorder_server_xml = eosmetrics_dep.get_variable(pkgconfig: 'datadir') / 'eos-metrics' / 'com.endlessm.Metrics.xml'
default_metrics_server_url = get_option('default_metrics_server_url')
prefix = get_option('prefix')
libexec_dir = join_paths(prefix, get_option('libexecdir'))
config_dir = get_option('sysconfdir') / 'metrics'
permissions_file = config_dir / 'eos-metrics-permissions.conf'
persistent_cache_dir = get_option('localstatedir') / 'cache' / 'metrics' / 'v3'
add_project_arguments(
[
'-DCONFIG_DIR="@0@"'.format(config_dir),
'-DPERMISSIONS_FILE="@0@"'.format(permissions_file),
'-DPERSISTENT_CACHE_DIR="@0@"'.format(persistent_cache_dir),
'-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir')),
'-DGLIB_VERSION_MIN_REQUIRED=@0@'.format(glib_version_define),
'-DGLIB_VERSION_MAX_ALLOWED=@0@'.format(glib_version_define),
'-Wno-unused-parameter',
],
language: 'c',
)
conf_data = configuration_data()
conf_data.set_quoted('DEFAULT_METRICS_SERVER_URL', default_metrics_server_url)
configure_file(
output: 'config.h',
configuration: conf_data,
)
config_inc = include_directories('.')
# Allow the tests to be easily run under valgrind using --setup=valgrind
valgrind = find_program('valgrind', required: false)
if valgrind.found()
glib_suppression_file = glib_dep.get_variable(pkgconfig: 'prefix') / 'share/glib-2.0/valgrind/glib.supp'
valgrind_arguments = [
'--tool=memcheck',
'--error-exitcode=1',
'--track-origins=yes',
'--leak-check=full',
'--leak-resolution=high',
'--num-callers=50',
'--show-leak-kinds=definite,possible',
'--show-error-list=yes',
'--suppressions=@0@'.format(glib_suppression_file),
]
add_test_setup('valgrind',
exe_wrapper: [valgrind, valgrind_arguments],
# For a test which runs the entire daemon as a subprocess. We don't use
# --trace-children=yes because that test also spawns other things such as
# a dbus-daemon and we don't want to valgrind those.
env: {
'EXE_WRAPPER': ' '.join([valgrind.full_path()] + valgrind_arguments),
},
timeout_multiplier: 10,
)
endif
subdir('data')
subdir('shared')
subdir('daemon')
subdir('tools')
subdir('tests')