-
Notifications
You must be signed in to change notification settings - Fork 22
/
meson.build
168 lines (149 loc) · 4.28 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
project(
'phosphor-pid-control', 'cpp',
version : '1.0.0',
meson_version: '>=1.1.1',
default_options: [
'warning_level=3',
'werror=true',
'cpp_std=c++23',
'b_lto=true',
]
)
cxx = meson.get_compiler('cpp')
conf_data = configuration_data()
bindir = get_option('prefix') / get_option('bindir')
conf_data.set('BINDIR', bindir)
conf_data.set('SYSTEMD_TARGET', get_option('systemd_target'))
conf_data.set('STRICT_FAILSAFE_PWM', get_option('strict-failsafe-pwm'))
conf_data.set('OFFLINE_FAILSAFE_PWM', get_option('offline-failsafe-pwm'))
conf_data.set('UNC_FAILSAFE', get_option('unc-failsafe'))
configure_file(output: 'config.h',
configuration: conf_data
)
if get_option('oe-sdk').allowed()
OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip()
if OECORE_TARGET_SYSROOT == ''
error('OECORE_TARGET_SYSROOT must be set with enable oe-sdk')
endif
message('Enabling OE-SDK at OECORE_TARGET_SYSROOT: ' + OECORE_TARGET_SYSROOT)
rpath = ':'.join([OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib'])
ld_so = run_command('sh', '-c', 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1').stdout().strip()
dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so]
else
dynamic_linker = []
endif
systemd = dependency('systemd')
systemd_system_unit_dir = systemd.get_variable(
'systemdsystemunitdir',
pkgconfig_define: ['prefix', get_option('prefix')])
configure_file(input: 'phosphor-pid-control.service.in',
output: 'phosphor-pid-control.service',
configuration: conf_data,
install: true,
install_dir: systemd_system_unit_dir)
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
phosphor_logging_dep = dependency('phosphor-logging')
sdbusplus_dep = dependency('sdbusplus')
libsystemd_dep = dependency('libsystemd')
ipmid_dep = dependency('libipmid')
if cxx.has_header('CLI/CLI.hpp')
CLI11_dep = declare_dependency()
else
CLI11_dep = dependency('CLI11')
endif
deps = [
CLI11_dep,
ipmid_dep,
libsystemd_dep,
nlohmann_json_dep,
phosphor_dbus_interfaces_dep,
phosphor_logging_dep,
sdbusplus_dep,
]
root_inc = include_directories(
'.',
'buildjson',
'dbus',
'errors',
'experiments',
'ipmi',
'notimpl',
'pid',
'sensors',
'sysfs',
)
setsensor_sources = [
'setsensor.cpp'
]
libswampd_sources = [
'main.cpp',
'util.cpp',
'notimpl/readonly.cpp',
'notimpl/writeonly.cpp',
'dbus/dbusconfiguration.cpp',
'dbus/dbusutil.cpp',
'dbus/dbushelper.cpp',
'dbus/dbuspassiveredundancy.cpp',
'dbus/dbuspassive.cpp',
'dbus/dbusactiveread.cpp',
'dbus/dbuswrite.cpp',
'sysfs/sysfsread.cpp',
'sysfs/sysfswrite.cpp',
'sysfs/util.cpp',
'sensors/pluggable.cpp',
'sensors/host.cpp',
'sensors/builder.cpp',
'sensors/buildjson.cpp',
'sensors/manager.cpp',
'sensors/build_utils.cpp',
'pid/ec/pid.cpp',
'pid/ec/logging.cpp',
'pid/ec/stepwise.cpp',
'pid/fancontroller.cpp',
'pid/thermalcontroller.cpp',
'pid/pidcontroller.cpp',
'pid/stepwisecontroller.cpp',
'pid/builder.cpp',
'pid/buildjson.cpp',
'pid/zone.cpp',
'pid/util.cpp',
'pid/pidloop.cpp',
'pid/tuning.cpp',
'buildjson/buildjson.cpp',
'experiments/drive.cpp',
]
libmanualcmds_sources = [
'ipmi/main_ipmi.cpp',
'ipmi/manualcmds.cpp',
'ipmi/dbus_mode.cpp',
]
libmanualcmds = library(
'manualcmds',
libmanualcmds_sources,
implicit_include_directories: false,
dependencies: deps,
version: meson.project_version(),
override_options: ['b_lundef=false'],
install: true,
install_dir: get_option('libdir') / 'ipmid-providers')
executable(
'swampd',
libswampd_sources,
implicit_include_directories: false,
include_directories: root_inc,
dependencies: deps,
install: true,
install_dir: get_option('bindir')
)
executable(
'setsensor',
setsensor_sources,
implicit_include_directories: true,
dependencies: deps,
install: true,
install_dir: get_option('bindir')
)
if not get_option('tests').disabled()
subdir('test')
endif