-
Notifications
You must be signed in to change notification settings - Fork 140
/
Copy pathmeson.build
68 lines (58 loc) · 1.89 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
project('irqbalance', 'c',
version: '1.9.4',
default_options: ['warning_level=1'],
meson_version: '>=0.54.0',
)
cc = meson.get_compiler('c')
glib_dep = dependency('glib-2.0')
m_dep = cc.find_library('m', required: false)
capng_dep = dependency('libcap-ng', required: get_option('capng'))
ncurses_dep = dependency('curses', required: get_option('ui'))
numa_dep = cc.find_library('numa', required: get_option('numa'))
libnl_3_dep = dependency('libnl-3.0', required: get_option('thermal'))
libnl_genl_3_dep = dependency('libnl-genl-3.0', required: get_option('thermal'))
systemd_dep = dependency('libsystemd', required: get_option('systemd'))
cdata = configuration_data()
cdata.set('HAVE_GETOPT_LONG', cc.has_function('getopt_long'))
cdata.set('HAVE_IRQBALANCEUI', ncurses_dep.found())
cdata.set('HAVE_NUMA_H', cc.has_header('numa.h') and numa_dep.found())
cdata.set('HAVE_THERMAL', libnl_3_dep.found() and libnl_genl_3_dep.found())
cdata.set('HAVE_LIBCAP_NG', capng_dep.found())
cdata.set('HAVE_LIBSYSTEMD', systemd_dep.found())
cdata.set_quoted('VERSION', meson.project_version())
cfile = configure_file(output: 'config.h', configuration: cdata)
if cdata.get('HAVE_IRQBALANCEUI')
add_project_arguments('-D_GNU_SOURCE', language: 'c')
executable(
'irqbalance-ui',
'ui/helpers.c',
'ui/irqbalance-ui.c',
'ui/ui.c',
dependencies: [glib_dep, ncurses_dep],
install: true,
)
install_man('irqbalance-ui.1')
endif
irqbalance_sources = files(
'activate.c',
'bitmap.c',
'classify.c',
'cputree.c',
'irqbalance.c',
'irqlist.c',
'numa.c',
'placement.c',
'procinterrupts.c',
)
if libnl_3_dep.found() and libnl_genl_3_dep.found()
irqbalance_sources += files(
'thermal.c',
)
endif
executable(
'irqbalance',
irqbalance_sources,
dependencies: [glib_dep, m_dep, capng_dep, libnl_3_dep, libnl_genl_3_dep, numa_dep, systemd_dep],
install: true,
)
install_man('irqbalance.1')