blob: 665517a3b8cf4d9d5a5762f4ef4f4e41af82006c [file] [log] [blame]
Andrew Jefferye73bd0a2023-01-25 10:39:57 +10301conf_data = configuration_data()
2conf_data.set10('VALIDATION_UNSECURE_FEATURE', get_option('validate-unsecure-feature').enabled())
3conf_data.set10('INSECURE_UNRESTRICTED_SENSOR_OVERRIDE', get_option('insecure-sensor-override').enabled())
4configure_file(input: 'dbus-sensor_config.h.in',
5 output: 'dbus-sensor_config.h',
6 configuration: conf_data)
7
8thresholds_a = static_library(
9 'thresholds_a',
10 'Thresholds.cpp',
11 dependencies: default_deps,
12)
13
14thresholds_dep = declare_dependency(
15 link_with: [ thresholds_a ],
16 dependencies: default_deps,
17)
18
19utils_a = static_library(
20 'utils_a',
21 [
22 'FileHandle.cpp',
23 'SensorPaths.cpp',
24 'Utils.cpp',
25 ],
26 dependencies: default_deps,
27)
28
29utils_dep = declare_dependency(
30 link_with: [ utils_a ],
31 dependencies: [ sdbusplus ],
32)
33
34devicemgmt_a = static_library(
35 'devicemgmt_a',
36 [
37 'DeviceMgmt.cpp',
38 ],
39 dependencies: default_deps,
40)
41
42devicemgmt_dep = declare_dependency(
43 link_with: [ devicemgmt_a ],
44 dependencies: default_deps,
45)
46
47pwmsensor_a = static_library(
48 'pwmsensor_a',
49 'PwmSensor.cpp',
50 dependencies: [ default_deps, thresholds_dep ],
51)
52
53pwmsensor_dep = declare_dependency(
54 link_with: [ pwmsensor_a ],
55 dependencies: [ default_deps, thresholds_dep ],
56)
57
Brad Bishopfeb19ef2019-11-07 18:02:16 -050058peci_incdirs = []
59if not meson.get_compiler('cpp').has_header('linux/peci-ioctl.h')
60 peci_incdirs = ['../include']
61endif
62
63if get_option('adc').enabled()
64 executable(
65 'adcsensor',
66 'ADCSensor.cpp',
67 'ADCSensorMain.cpp',
68 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050069 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050070 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050071 thresholds_dep,
72 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050073 ],
Ed Tanous16966b52021-09-15 15:06:59 -070074 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050075 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050076 )
77endif
78
Thu Nguyen255da6b2022-07-29 10:05:52 +070079if get_option('intel-cpu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -050080 executable(
Thu Nguyen255da6b2022-07-29 10:05:52 +070081 'intelcpusensor',
82 'IntelCPUSensorMain.cpp',
83 'IntelCPUSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -050084 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050085 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050086 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050087 thresholds_dep,
88 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050089 ],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103090 include_directories: peci_incdirs,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050091 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050092 )
93endif
94
95if get_option('exit-air').enabled()
96 executable(
97 'exitairtempsensor',
98 'ExitAirTempSensor.cpp',
99 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500100 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500101 thresholds_dep,
102 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500103 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700104 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500105 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500106 )
107endif
108
109if get_option('fan').enabled()
110 executable(
111 'fansensor',
112 'FanMain.cpp',
113 'TachSensor.cpp',
114 'PwmSensor.cpp',
115 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500116 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500117 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500118 thresholds_dep,
119 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500120 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700121 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500122 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500123 )
124endif
125
126if get_option('hwmon-temp').enabled()
127 executable(
128 'hwmontempsensor',
129 'HwmonTempMain.cpp',
130 'HwmonTempSensor.cpp',
131 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500132 default_deps,
Zev Weissa1456c42022-07-18 16:59:35 -0700133 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500134 thresholds_dep,
135 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500136 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700137 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500138 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500139 )
140endif
141
142if get_option('intrusion').enabled()
143 executable(
144 'intrusionsensor',
145 'ChassisIntrusionSensor.cpp',
146 'IntrusionSensorMain.cpp',
147 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500148 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500149 gpiodcxx,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500150 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500151 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500152 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700153 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500154 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500155 )
156endif
157
158if get_option('ipmb').enabled()
159 executable(
160 'ipmbsensor',
161 'IpmbSensor.cpp',
Jayashree Dhanapal3746c552022-03-21 14:45:52 +0530162 'IpmbSDRSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500163 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500164 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500165 thresholds_dep,
166 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500167 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700168 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500169 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500170 )
171endif
172
Ed Tanous49d12d82021-02-11 13:44:15 -0800173if get_option('mcu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500174 executable(
175 'mcutempsensor',
176 'MCUTempSensor.cpp',
177 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500178 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500179 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500180 thresholds_dep,
181 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500182 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700183 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500184 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500185 )
186endif
187
188if get_option('nvme').enabled()
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930189 nvme_srcs = files('NVMeSensorMain.cpp', 'NVMeSensor.cpp')
190 nvme_srcs += files('NVMeBasicContext.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930191
Andrew Jeffery6f25e7e2021-05-24 12:52:53 +0930192 nvme_deps = [ default_deps, i2c, thresholds_dep, utils_dep, threads ]
193
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500194 executable(
195 'nvmesensor',
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930196 sources: nvme_srcs,
197 dependencies: nvme_deps,
Ed Tanous16966b52021-09-15 15:06:59 -0700198 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500199 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500200 )
201endif
202
Lei YU3a18b862021-02-05 13:55:08 +0800203if get_option('psu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500204 executable(
Lei YU3a18b862021-02-05 13:55:08 +0800205 'psusensor',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500206 'PSUEvent.cpp',
207 'PSUSensor.cpp',
208 'PSUSensorMain.cpp',
209 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500210 default_deps,
Matt Simmering786efb82023-01-18 14:09:21 -0800211 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500212 pwmsensor_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500213 thresholds_dep,
214 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500215 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700216 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500217 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500218 )
219endif
220
221if get_option('external').enabled()
222 executable(
223 'externalsensor',
224 'ExternalSensor.cpp',
225 'ExternalSensorMain.cpp',
226 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500227 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500228 thresholds_dep,
229 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500230 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700231 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500232 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500233 )
234endif