blob: 0adbabcaa29aa31f74d126237547e75480b48953 [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
Oleksandr Shulzhenko77141ac2023-03-14 14:52:36 +010063if get_option('intel-cpu').enabled()
64 peci_dep = meson.get_compiler('cpp').find_library('libpeci', required : false)
65 if not peci_dep.found()
66 cmake = import('cmake')
67 opt = cmake.subproject_options()
68 opt.append_compile_args('c', '-Wno-pedantic')
69 peci_proj = cmake.subproject('libpeci', options : opt)
70 peci_dep = peci_proj.dependency('peci')
71 endif
72endif
73
Brad Bishopfeb19ef2019-11-07 18:02:16 -050074if get_option('adc').enabled()
75 executable(
76 'adcsensor',
77 'ADCSensor.cpp',
78 'ADCSensorMain.cpp',
79 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050080 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050081 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050082 thresholds_dep,
83 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050084 ],
Ed Tanous16966b52021-09-15 15:06:59 -070085 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050086 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050087 )
88endif
89
Thu Nguyen255da6b2022-07-29 10:05:52 +070090if get_option('intel-cpu').enabled()
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
107if get_option('exit-air').enabled()
108 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 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700116 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500117 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500118 )
119endif
120
121if get_option('fan').enabled()
122 executable(
123 'fansensor',
124 'FanMain.cpp',
125 '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 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700133 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500134 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500135 )
136endif
137
138if get_option('hwmon-temp').enabled()
139 executable(
140 'hwmontempsensor',
141 'HwmonTempMain.cpp',
142 'HwmonTempSensor.cpp',
143 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500144 default_deps,
Zev Weissa1456c42022-07-18 16:59:35 -0700145 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500146 thresholds_dep,
147 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500148 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700149 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500150 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500151 )
152endif
153
154if get_option('intrusion').enabled()
155 executable(
156 'intrusionsensor',
157 'ChassisIntrusionSensor.cpp',
158 'IntrusionSensorMain.cpp',
159 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500160 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500161 gpiodcxx,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500162 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500163 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500164 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700165 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500166 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500167 )
168endif
169
170if get_option('ipmb').enabled()
171 executable(
172 'ipmbsensor',
173 'IpmbSensor.cpp',
Jayashree Dhanapal3746c552022-03-21 14:45:52 +0530174 'IpmbSDRSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500175 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500176 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500177 thresholds_dep,
178 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500179 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700180 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500181 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500182 )
183endif
184
Ed Tanous49d12d82021-02-11 13:44:15 -0800185if get_option('mcu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500186 executable(
187 'mcutempsensor',
188 'MCUTempSensor.cpp',
189 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500190 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500191 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500192 thresholds_dep,
193 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500194 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700195 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500196 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500197 )
198endif
199
200if get_option('nvme').enabled()
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930201 nvme_srcs = files('NVMeSensorMain.cpp', 'NVMeSensor.cpp')
202 nvme_srcs += files('NVMeBasicContext.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930203
Andrew Jeffery6f25e7e2021-05-24 12:52:53 +0930204 nvme_deps = [ default_deps, i2c, thresholds_dep, utils_dep, threads ]
205
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500206 executable(
207 'nvmesensor',
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930208 sources: nvme_srcs,
209 dependencies: nvme_deps,
Ed Tanous16966b52021-09-15 15:06:59 -0700210 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500211 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500212 )
213endif
214
Lei YU3a18b862021-02-05 13:55:08 +0800215if get_option('psu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500216 executable(
Lei YU3a18b862021-02-05 13:55:08 +0800217 'psusensor',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500218 'PSUEvent.cpp',
219 'PSUSensor.cpp',
220 'PSUSensorMain.cpp',
221 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500222 default_deps,
Matt Simmering786efb82023-01-18 14:09:21 -0800223 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500224 pwmsensor_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500225 thresholds_dep,
226 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500227 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700228 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500229 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500230 )
231endif
232
233if get_option('external').enabled()
234 executable(
235 'externalsensor',
236 'ExternalSensor.cpp',
237 'ExternalSensorMain.cpp',
238 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500239 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500240 thresholds_dep,
241 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500242 ],
Ed Tanous16966b52021-09-15 15:06:59 -0700243 cpp_args: uring_args,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500244 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500245 )
246endif