-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmeson.build
65 lines (59 loc) · 1.52 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
project(
'phosphor-virtual-sensor',
'cpp',
version: '1.0',
default_options: [
'buildtype=debugoptimized',
'cpp_std=c++23',
'warning_level=3',
'werror=true',
],
meson_version: '>=1.1.1',
)
cpp = meson.get_compiler('cpp')
if cpp.has_header('exprtk.hpp')
exprtk = declare_dependency()
else
subproject('exprtk', required: false)
exprtk = declare_dependency(
include_directories: 'subprojects/exprtk'
)
endif
executable(
'virtual-sensor',
[
'calculate.cpp',
'dbusSensor.cpp',
'dbusUtils.cpp',
'main.cpp',
'virtualSensor.cpp',
],
dependencies: [
dependency('nlohmann_json', include_type: 'system'),
dependency('phosphor-dbus-interfaces'),
dependency('phosphor-logging'),
dependency('sdbusplus'),
exprtk,
],
install: true,
install_dir: get_option('bindir')
)
packagedir = join_paths(
get_option('prefix'),
get_option('datadir'),
meson.project_name(),
)
install_data(sources : 'virtual_sensor_config.json', install_dir : packagedir)
systemd = dependency('systemd')
conf_data = configuration_data()
conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
configure_file(
input: 'phosphor-virtual-sensor.service.in',
output: 'phosphor-virtual-sensor.service',
configuration: conf_data,
install: true,
install_dir: systemd.get_variable('systemdsystemunitdir'))
build_tests = get_option('tests')
if build_tests.allowed()
subdir('test')
endif