-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmeson.build
137 lines (117 loc) · 2.93 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
project(
'phosphor-gpio-monitor',
'cpp',
default_options: [
'warning_level=3',
'werror=true',
'cpp_std=c++23',
'buildtype=debugoptimized',
],
license: 'Apache-2.0',
version: '1.0',
meson_version: '>=1.1.1',
)
cxx = meson.get_compiler('cpp')
libevdev = dependency('libevdev')
libsystemd = dependency('libsystemd')
libgpiod = dependency('libgpiod')
phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
phosphor_logging = dependency('phosphor-logging')
sdbusplus = dependency('sdbusplus')
systemd = dependency('systemd')
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
if cxx.has_header('CLI/CLI.hpp')
cli11_dep = declare_dependency()
else
cli11_dep = dependency('CLI11')
endif
boost_args = [
'-DBOOST_ASIO_DISABLE_THREADS',
'-DBOOST_ERROR_CODE_HEADER_ONLY',
'-DBOOST_SYSTEM_NO_DEPRECATED',
]
boost_dep = dependency('boost')
systemd_system_unit_dir = systemd.get_variable(
'systemdsystemunitdir',
pkgconfig_define: ['prefix', get_option('prefix')],
)
fs = import('fs')
fs.copyfile(
install: true,
install_dir: systemd_system_unit_dir,
)
fs.copyfile(
'phosphor-multi-gpio-monitor.service',
install: true,
install_dir: systemd_system_unit_dir,
)
fs.copyfile(
'phosphor-multi-gpio-presence.service',
install: true,
install_dir: systemd_system_unit_dir,
)
fs.copyfile(
install: true,
install_dir: systemd_system_unit_dir,
)
udev = dependency('udev')
udev_rules_dir = join_paths(
udev.get_variable(
'udevdir',
pkgconfig_define: ['prefix', get_option('prefix')],
),
'rules.d',
)
fs.copyfile('99-gpio-keys.rules', install: true, install_dir: udev_rules_dir)
fs.copyfile(
'phosphor-multi-gpio-monitor.json',
install: true,
install_dir: get_option('datadir') / 'phosphor-gpio-monitor',
)
libevdev_o = static_library(
'libevdev_o',
'evdev.cpp',
dependencies: [
libevdev,
phosphor_dbus_interfaces,
phosphor_logging,
sdbusplus,
],
)
libmonitor_o = static_library(
'libmonitor_o',
'monitor.cpp',
dependencies: [libevdev, libsystemd, phosphor_logging],
link_with: [libevdev_o],
)
phosphor_gpio_monitor = executable(
'phosphor-gpio-monitor',
'mainapp.cpp',
dependencies: [cli11_dep, libevdev, libsystemd, phosphor_logging],
install: true,
link_with: [libevdev_o, libmonitor_o],
)
executable(
'phosphor-multi-gpio-monitor',
'gpioMonMain.cpp',
'gpioMon.cpp',
dependencies: [
cli11_dep,
libgpiod,
nlohmann_json_dep,
phosphor_dbus_interfaces,
phosphor_logging,
sdbusplus,
boost_dep,
],
cpp_args: boost_args,
install: true,
)
subdir('presence')
subdir('multi-presence')
build_tests = get_option('tests')
if build_tests.allowed()
subdir('test')
endif