blob: 6fb66a1f54220f53b1807c9dbc1aeca85148d3cb [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',
124 'TachSensor.cpp',
125 'PwmSensor.cpp',
126 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500127 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500128 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500129 thresholds_dep,
130 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500131 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500132 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500133 )
134endif
135
Patrick Williams5bc307f2023-11-29 06:44:23 -0600136if get_option('hwmon-temp').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500137 executable(
138 'hwmontempsensor',
139 'HwmonTempMain.cpp',
140 'HwmonTempSensor.cpp',
141 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500142 default_deps,
Zev Weissa1456c42022-07-18 16:59:35 -0700143 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500144 thresholds_dep,
145 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500146 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500147 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500148 )
149endif
150
Patrick Williams5bc307f2023-11-29 06:44:23 -0600151if get_option('intrusion').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500152 executable(
153 'intrusionsensor',
154 'ChassisIntrusionSensor.cpp',
155 'IntrusionSensorMain.cpp',
156 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500157 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500158 gpiodcxx,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500159 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500160 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500161 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500162 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500163 )
164endif
165
Patrick Williams5bc307f2023-11-29 06:44:23 -0600166if get_option('ipmb').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500167 executable(
168 'ipmbsensor',
Ed Tanous828c5a62024-02-09 16:59:22 -0800169 'IpmbSensorMain.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500170 'IpmbSensor.cpp',
Jayashree Dhanapal3746c552022-03-21 14:45:52 +0530171 'IpmbSDRSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500172 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500173 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500174 thresholds_dep,
175 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500176 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500177 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500178 )
179endif
180
Patrick Williams5bc307f2023-11-29 06:44:23 -0600181if get_option('mcu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500182 executable(
183 'mcutempsensor',
184 'MCUTempSensor.cpp',
185 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500186 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500187 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500188 thresholds_dep,
189 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500190 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500191 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500192 )
193endif
194
Patrick Williams5bc307f2023-11-29 06:44:23 -0600195if get_option('nvme').allowed()
Andrew Jefferyab8b0452024-01-11 09:55:51 +1030196 nvme_srcs = files('NVMeSensor.cpp', 'NVMeSensorMain.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930197 nvme_srcs += files('NVMeBasicContext.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930198
Andrew Jefferyab8b0452024-01-11 09:55:51 +1030199 nvme_deps = [default_deps, i2c, thresholds_dep, utils_dep, threads]
Andrew Jeffery6f25e7e2021-05-24 12:52:53 +0930200
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500201 executable(
202 'nvmesensor',
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930203 sources: nvme_srcs,
204 dependencies: nvme_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500205 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500206 )
207endif
208
Patrick Williams5bc307f2023-11-29 06:44:23 -0600209if get_option('psu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500210 executable(
Lei YU3a18b862021-02-05 13:55:08 +0800211 'psusensor',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500212 'PSUEvent.cpp',
213 'PSUSensor.cpp',
214 'PSUSensorMain.cpp',
215 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500216 default_deps,
Matt Simmering786efb82023-01-18 14:09:21 -0800217 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500218 pwmsensor_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500219 thresholds_dep,
220 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500221 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500222 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500223 )
224endif
225
Patrick Williams5bc307f2023-11-29 06:44:23 -0600226if get_option('external').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500227 executable(
228 'externalsensor',
229 'ExternalSensor.cpp',
230 'ExternalSensorMain.cpp',
231 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500232 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500233 thresholds_dep,
234 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500235 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500236 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500237 )
238endif