blob: 429f7c5de52cc2e8a80bd3a9f009ebeafd50e2cf [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',
169 'IpmbSensor.cpp',
Jayashree Dhanapal3746c552022-03-21 14:45:52 +0530170 'IpmbSDRSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500171 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500172 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500173 thresholds_dep,
174 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500175 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500176 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500177 )
178endif
179
Patrick Williams5bc307f2023-11-29 06:44:23 -0600180if get_option('mcu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500181 executable(
182 'mcutempsensor',
183 'MCUTempSensor.cpp',
184 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500185 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500186 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500187 thresholds_dep,
188 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500189 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500190 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500191 )
192endif
193
Patrick Williams5bc307f2023-11-29 06:44:23 -0600194if get_option('nvme').allowed()
Andrew Jefferyab8b0452024-01-11 09:55:51 +1030195 nvme_srcs = files('NVMeSensor.cpp', 'NVMeSensorMain.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930196 nvme_srcs += files('NVMeBasicContext.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930197
Andrew Jefferyab8b0452024-01-11 09:55:51 +1030198 nvme_deps = [default_deps, i2c, thresholds_dep, utils_dep, threads]
Andrew Jeffery6f25e7e2021-05-24 12:52:53 +0930199
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500200 executable(
201 'nvmesensor',
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930202 sources: nvme_srcs,
203 dependencies: nvme_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500204 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500205 )
206endif
207
Patrick Williams5bc307f2023-11-29 06:44:23 -0600208if get_option('psu').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500209 executable(
Lei YU3a18b862021-02-05 13:55:08 +0800210 'psusensor',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500211 'PSUEvent.cpp',
212 'PSUSensor.cpp',
213 'PSUSensorMain.cpp',
214 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500215 default_deps,
Matt Simmering786efb82023-01-18 14:09:21 -0800216 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500217 pwmsensor_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500218 thresholds_dep,
219 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500220 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500221 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500222 )
223endif
224
Patrick Williams5bc307f2023-11-29 06:44:23 -0600225if get_option('external').allowed()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500226 executable(
227 'externalsensor',
228 'ExternalSensor.cpp',
229 'ExternalSensorMain.cpp',
230 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500231 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500232 thresholds_dep,
233 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500234 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500235 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500236 )
237endif