blob: 12f8ee5653797747dc302591b23179fbf28140e4 [file] [log] [blame]
Andrew Jefferye73bd0a2023-01-25 10:39:57 +10301conf_data = configuration_data()
Andrew Jefferyab8b0452024-01-11 09:55:51 +10302conf_data.set10(
3 'VALIDATION_UNSECURE_FEATURE',
4 get_option('validate-unsecure-feature').allowed(),
5)
6conf_data.set10(
7 'INSECURE_UNRESTRICTED_SENSOR_OVERRIDE',
8 get_option('insecure-sensor-override').allowed(),
9)
10configure_file(
11 input: 'dbus-sensor_config.h.in',
12 output: 'dbus-sensor_config.h',
13 configuration: conf_data,
14)
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103015
16thresholds_a = static_library(
17 'thresholds_a',
18 'Thresholds.cpp',
19 dependencies: default_deps,
20)
21
22thresholds_dep = declare_dependency(
Andrew Jefferyab8b0452024-01-11 09:55:51 +103023 link_with: [thresholds_a],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103024 dependencies: default_deps,
25)
26
27utils_a = static_library(
28 'utils_a',
29 [
30 'FileHandle.cpp',
31 'SensorPaths.cpp',
32 'Utils.cpp',
33 ],
34 dependencies: default_deps,
35)
36
37utils_dep = declare_dependency(
Andrew Jefferyab8b0452024-01-11 09:55:51 +103038 link_with: [utils_a],
39 dependencies: [sdbusplus],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103040)
41
42devicemgmt_a = static_library(
43 'devicemgmt_a',
44 [
45 'DeviceMgmt.cpp',
46 ],
47 dependencies: default_deps,
48)
49
50devicemgmt_dep = declare_dependency(
Andrew Jefferyab8b0452024-01-11 09:55:51 +103051 link_with: [devicemgmt_a],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103052 dependencies: default_deps,
53)
54
55pwmsensor_a = static_library(
56 'pwmsensor_a',
57 'PwmSensor.cpp',
Andrew Jefferyab8b0452024-01-11 09:55:51 +103058 dependencies: [default_deps, thresholds_dep],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103059)
60
61pwmsensor_dep = declare_dependency(
Andrew Jefferyab8b0452024-01-11 09:55:51 +103062 link_with: [pwmsensor_a],
63 dependencies: [default_deps, thresholds_dep],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103064)
65
Brad Bishopfeb19ef2019-11-07 18:02:16 -050066peci_incdirs = []
67if not meson.get_compiler('cpp').has_header('linux/peci-ioctl.h')
68 peci_incdirs = ['../include']
69endif
70
Patrick Williams5bc307f2023-11-29 06:44:23 -060071if get_option('intel-cpu').allowed()
Andrew Jefferyab8b0452024-01-11 09:55:51 +103072 peci_dep = dependency('libpeci', required: true)
Oleksandr Shulzhenko77141ac2023-03-14 14:52:36 +010073endif
74
Patrick Williams5bc307f2023-11-29 06:44:23 -060075if get_option('adc').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -050076 executable(
77 'adcsensor',
78 'ADCSensor.cpp',
79 'ADCSensorMain.cpp',
80 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050081 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050082 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050083 thresholds_dep,
84 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050085 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050086 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050087 )
88endif
89
Patrick Williams5bc307f2023-11-29 06:44:23 -060090if get_option('intel-cpu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -050091 executable(
Thu Nguyen255da6b2022-07-29 10:05:52 +070092 'intelcpusensor',
93 'IntelCPUSensorMain.cpp',
94 'IntelCPUSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -050095 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050096 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050097 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050098 thresholds_dep,
99 utils_dep,
Oleksandr Shulzhenko77141ac2023-03-14 14:52:36 +0100100 peci_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500101 ],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +1030102 include_directories: peci_incdirs,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500103 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500104 )
105endif
106
Patrick Williams5bc307f2023-11-29 06:44:23 -0600107if get_option('exit-air').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500108 executable(
109 'exitairtempsensor',
110 'ExitAirTempSensor.cpp',
111 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500112 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500113 thresholds_dep,
114 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500115 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500116 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500117 )
118endif
119
Patrick Williams5bc307f2023-11-29 06:44:23 -0600120if get_option('fan').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500121 executable(
122 'fansensor',
123 'FanMain.cpp',
Chris Cain83929002024-03-06 14:20:09 -0600124 'PresenceGpio.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500125 'TachSensor.cpp',
126 'PwmSensor.cpp',
127 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500128 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500129 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500130 thresholds_dep,
131 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500132 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500133 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500134 )
135endif
136
Patrick Williams5bc307f2023-11-29 06:44:23 -0600137if get_option('hwmon-temp').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500138 executable(
139 'hwmontempsensor',
140 'HwmonTempMain.cpp',
141 'HwmonTempSensor.cpp',
142 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500143 default_deps,
Zev Weissa1456c42022-07-18 16:59:35 -0700144 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500145 thresholds_dep,
146 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500147 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500148 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500149 )
150endif
151
Patrick Williams5bc307f2023-11-29 06:44:23 -0600152if get_option('intrusion').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500153 executable(
154 'intrusionsensor',
155 'ChassisIntrusionSensor.cpp',
156 'IntrusionSensorMain.cpp',
157 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500158 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500159 gpiodcxx,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500160 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500161 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500162 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500163 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500164 )
165endif
166
Patrick Williams5bc307f2023-11-29 06:44:23 -0600167if get_option('ipmb').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500168 executable(
169 'ipmbsensor',
Ed Tanous828c5a62024-02-09 16:59:22 -0800170 'IpmbSensorMain.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500171 'IpmbSensor.cpp',
Jayashree Dhanapal3746c552022-03-21 14:45:52 +0530172 'IpmbSDRSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500173 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500174 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500175 thresholds_dep,
176 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500177 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500178 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500179 )
180endif
181
Patrick Williams5bc307f2023-11-29 06:44:23 -0600182if get_option('mcu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500183 executable(
184 'mcutempsensor',
185 'MCUTempSensor.cpp',
186 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500187 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500188 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500189 thresholds_dep,
190 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500191 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500192 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500193 )
194endif
195
Patrick Williams5bc307f2023-11-29 06:44:23 -0600196if get_option('nvme').allowed()
Andrew Jefferyab8b0452024-01-11 09:55:51 +1030197 nvme_srcs = files('NVMeSensor.cpp', 'NVMeSensorMain.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930198 nvme_srcs += files('NVMeBasicContext.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930199
Andrew Jefferyab8b0452024-01-11 09:55:51 +1030200 nvme_deps = [default_deps, i2c, thresholds_dep, utils_dep, threads]
Andrew Jeffery6f25e7e2021-05-24 12:52:53 +0930201
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500202 executable(
203 'nvmesensor',
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930204 sources: nvme_srcs,
205 dependencies: nvme_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500206 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500207 )
208endif
209
Patrick Williams5bc307f2023-11-29 06:44:23 -0600210if get_option('psu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500211 executable(
Lei YU3a18b862021-02-05 13:55:08 +0800212 'psusensor',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500213 'PSUEvent.cpp',
214 'PSUSensor.cpp',
215 'PSUSensorMain.cpp',
216 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500217 default_deps,
Matt Simmering786efb82023-01-18 14:09:21 -0800218 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500219 pwmsensor_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500220 thresholds_dep,
221 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500222 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500223 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500224 )
225endif
226
Patrick Williams5bc307f2023-11-29 06:44:23 -0600227if get_option('external').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500228 executable(
229 'externalsensor',
230 'ExternalSensor.cpp',
231 'ExternalSensorMain.cpp',
232 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500233 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500234 thresholds_dep,
235 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500236 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500237 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500238 )
239endif