blob: f0403ab7c85a9eaa9aa13b1ccafdd96fb8e2f8ec [file] [log] [blame]
Andrew Jefferye73bd0a2023-01-25 10:39:57 +10301conf_data = configuration_data()
Patrick Williams5bc307f2023-11-29 06:44:23 -06002conf_data.set10('VALIDATION_UNSECURE_FEATURE', get_option('validate-unsecure-feature').allowed())
3conf_data.set10('INSECURE_UNRESTRICTED_SENSOR_OVERRIDE', get_option('insecure-sensor-override').allowed())
Andrew Jefferye73bd0a2023-01-25 10:39:57 +10304configure_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
Patrick Williams5bc307f2023-11-29 06:44:23 -060063if get_option('intel-cpu').allowed()
Ed Tanous934d37d2023-09-07 12:44:23 -070064 peci_dep = dependency('libpeci', required : true)
Oleksandr Shulzhenko77141ac2023-03-14 14:52:36 +010065endif
66
Patrick Williams5bc307f2023-11-29 06:44:23 -060067if get_option('adc').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -050068 executable(
69 'adcsensor',
70 'ADCSensor.cpp',
71 'ADCSensorMain.cpp',
72 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050073 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050074 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050075 thresholds_dep,
76 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050077 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050078 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050079 )
80endif
81
Patrick Williams5bc307f2023-11-29 06:44:23 -060082if get_option('intel-cpu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -050083 executable(
Thu Nguyen255da6b2022-07-29 10:05:52 +070084 'intelcpusensor',
85 'IntelCPUSensorMain.cpp',
86 'IntelCPUSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -050087 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050088 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050089 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050090 thresholds_dep,
91 utils_dep,
Oleksandr Shulzhenko77141ac2023-03-14 14:52:36 +010092 peci_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050093 ],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103094 include_directories: peci_incdirs,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050095 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050096 )
97endif
98
Patrick Williams5bc307f2023-11-29 06:44:23 -060099if get_option('exit-air').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500100 executable(
101 'exitairtempsensor',
102 'ExitAirTempSensor.cpp',
103 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500104 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500105 thresholds_dep,
106 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500107 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500108 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500109 )
110endif
111
Patrick Williams5bc307f2023-11-29 06:44:23 -0600112if get_option('fan').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500113 executable(
114 'fansensor',
115 'FanMain.cpp',
116 'TachSensor.cpp',
117 'PwmSensor.cpp',
118 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500119 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500120 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500121 thresholds_dep,
122 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500123 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500124 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500125 )
126endif
127
Patrick Williams5bc307f2023-11-29 06:44:23 -0600128if get_option('hwmon-temp').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500129 executable(
130 'hwmontempsensor',
131 'HwmonTempMain.cpp',
132 'HwmonTempSensor.cpp',
133 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500134 default_deps,
Zev Weissa1456c42022-07-18 16:59:35 -0700135 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500136 thresholds_dep,
137 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500138 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500139 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500140 )
141endif
142
Patrick Williams5bc307f2023-11-29 06:44:23 -0600143if get_option('intrusion').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500144 executable(
145 'intrusionsensor',
146 'ChassisIntrusionSensor.cpp',
147 'IntrusionSensorMain.cpp',
148 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500149 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500150 gpiodcxx,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500151 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500152 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500153 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500154 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500155 )
156endif
157
Patrick Williams5bc307f2023-11-29 06:44:23 -0600158if get_option('ipmb').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500159 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 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500168 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500169 )
170endif
171
Patrick Williams5bc307f2023-11-29 06:44:23 -0600172if get_option('mcu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500173 executable(
174 'mcutempsensor',
175 'MCUTempSensor.cpp',
176 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500177 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500178 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500179 thresholds_dep,
180 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500181 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500182 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500183 )
184endif
185
Patrick Williams5bc307f2023-11-29 06:44:23 -0600186if get_option('nvme').allowed()
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930187 nvme_srcs = files('NVMeSensorMain.cpp', 'NVMeSensor.cpp')
188 nvme_srcs += files('NVMeBasicContext.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930189
Andrew Jeffery6f25e7e2021-05-24 12:52:53 +0930190 nvme_deps = [ default_deps, i2c, thresholds_dep, utils_dep, threads ]
191
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500192 executable(
193 'nvmesensor',
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930194 sources: nvme_srcs,
195 dependencies: nvme_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500196 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500197 )
198endif
199
Patrick Williams5bc307f2023-11-29 06:44:23 -0600200if get_option('psu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500201 executable(
Lei YU3a18b862021-02-05 13:55:08 +0800202 'psusensor',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500203 'PSUEvent.cpp',
204 'PSUSensor.cpp',
205 'PSUSensorMain.cpp',
206 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500207 default_deps,
Matt Simmering786efb82023-01-18 14:09:21 -0800208 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500209 pwmsensor_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500210 thresholds_dep,
211 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500212 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500213 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500214 )
215endif
216
Patrick Williams5bc307f2023-11-29 06:44:23 -0600217if get_option('external').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500218 executable(
219 'externalsensor',
220 'ExternalSensor.cpp',
221 'ExternalSensorMain.cpp',
222 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500223 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500224 thresholds_dep,
225 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500226 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500227 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500228 )
229endif