blob: 9f56c3159deb2f0309cb00b96bae8ab67f04a7c3 [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 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050085 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050086 )
87endif
88
Thu Nguyen255da6b2022-07-29 10:05:52 +070089if get_option('intel-cpu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -050090 executable(
Thu Nguyen255da6b2022-07-29 10:05:52 +070091 'intelcpusensor',
92 'IntelCPUSensorMain.cpp',
93 'IntelCPUSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -050094 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -050095 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -050096 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -050097 thresholds_dep,
98 utils_dep,
Oleksandr Shulzhenko77141ac2023-03-14 14:52:36 +010099 peci_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500100 ],
Andrew Jefferye73bd0a2023-01-25 10:39:57 +1030101 include_directories: peci_incdirs,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500102 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500103 )
104endif
105
106if get_option('exit-air').enabled()
107 executable(
108 'exitairtempsensor',
109 'ExitAirTempSensor.cpp',
110 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500111 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500112 thresholds_dep,
113 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500114 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500115 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500116 )
117endif
118
119if get_option('fan').enabled()
120 executable(
121 'fansensor',
122 'FanMain.cpp',
123 'TachSensor.cpp',
124 'PwmSensor.cpp',
125 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500126 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500127 gpiodcxx,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500128 thresholds_dep,
129 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500130 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500131 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500132 )
133endif
134
135if get_option('hwmon-temp').enabled()
136 executable(
137 'hwmontempsensor',
138 'HwmonTempMain.cpp',
139 'HwmonTempSensor.cpp',
140 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500141 default_deps,
Zev Weissa1456c42022-07-18 16:59:35 -0700142 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500143 thresholds_dep,
144 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500145 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500146 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500147 )
148endif
149
150if get_option('intrusion').enabled()
151 executable(
152 'intrusionsensor',
153 'ChassisIntrusionSensor.cpp',
154 'IntrusionSensorMain.cpp',
155 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500156 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500157 gpiodcxx,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500158 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500159 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500160 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500161 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500162 )
163endif
164
165if get_option('ipmb').enabled()
166 executable(
167 'ipmbsensor',
168 'IpmbSensor.cpp',
Jayashree Dhanapal3746c552022-03-21 14:45:52 +0530169 'IpmbSDRSensor.cpp',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500170 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500171 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500172 thresholds_dep,
173 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500174 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500175 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500176 )
177endif
178
Ed Tanous49d12d82021-02-11 13:44:15 -0800179if get_option('mcu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500180 executable(
181 'mcutempsensor',
182 'MCUTempSensor.cpp',
183 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500184 default_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500185 i2c,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500186 thresholds_dep,
187 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500188 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500189 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500190 )
191endif
192
193if get_option('nvme').enabled()
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930194 nvme_srcs = files('NVMeSensorMain.cpp', 'NVMeSensor.cpp')
195 nvme_srcs += files('NVMeBasicContext.cpp')
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930196
Andrew Jeffery6f25e7e2021-05-24 12:52:53 +0930197 nvme_deps = [ default_deps, i2c, thresholds_dep, utils_dep, threads ]
198
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500199 executable(
200 'nvmesensor',
Andrew Jefferye3e3c972021-05-26 14:37:07 +0930201 sources: nvme_srcs,
202 dependencies: nvme_deps,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500203 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500204 )
205endif
206
Lei YU3a18b862021-02-05 13:55:08 +0800207if get_option('psu').enabled()
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500208 executable(
Lei YU3a18b862021-02-05 13:55:08 +0800209 'psusensor',
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500210 'PSUEvent.cpp',
211 'PSUSensor.cpp',
212 'PSUSensorMain.cpp',
213 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500214 default_deps,
Matt Simmering786efb82023-01-18 14:09:21 -0800215 devicemgmt_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500216 pwmsensor_dep,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500217 thresholds_dep,
218 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500219 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500220 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500221 )
222endif
223
224if get_option('external').enabled()
225 executable(
226 'externalsensor',
227 'ExternalSensor.cpp',
228 'ExternalSensorMain.cpp',
229 dependencies: [
Patrick Williams302a61a2021-08-27 15:40:08 -0500230 default_deps,
Patrick Williams8b8f6062021-08-27 14:53:50 -0500231 thresholds_dep,
232 utils_dep,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500233 ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500234 install: true,
Brad Bishopfeb19ef2019-11-07 18:02:16 -0500235 )
236endif