xref: /openbmc/dbus-sensors/src/meson.build (revision 83929002)
1conf_data = configuration_data()
2conf_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)
15
16thresholds_a = static_library(
17    'thresholds_a',
18    'Thresholds.cpp',
19    dependencies: default_deps,
20)
21
22thresholds_dep = declare_dependency(
23    link_with: [thresholds_a],
24    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(
38    link_with: [utils_a],
39    dependencies: [sdbusplus],
40)
41
42devicemgmt_a = static_library(
43    'devicemgmt_a',
44    [
45        'DeviceMgmt.cpp',
46    ],
47    dependencies: default_deps,
48)
49
50devicemgmt_dep = declare_dependency(
51    link_with: [devicemgmt_a],
52    dependencies: default_deps,
53)
54
55pwmsensor_a = static_library(
56    'pwmsensor_a',
57    'PwmSensor.cpp',
58    dependencies: [default_deps, thresholds_dep],
59)
60
61pwmsensor_dep = declare_dependency(
62    link_with: [pwmsensor_a],
63    dependencies: [default_deps, thresholds_dep],
64)
65
66peci_incdirs = []
67if not meson.get_compiler('cpp').has_header('linux/peci-ioctl.h')
68    peci_incdirs = ['../include']
69endif
70
71if get_option('intel-cpu').allowed()
72    peci_dep = dependency('libpeci', required: true)
73endif
74
75if get_option('adc').allowed()
76    executable(
77        'adcsensor',
78        'ADCSensor.cpp',
79        'ADCSensorMain.cpp',
80        dependencies: [
81            default_deps,
82            gpiodcxx,
83            thresholds_dep,
84            utils_dep,
85        ],
86        install: true,
87    )
88endif
89
90if get_option('intel-cpu').allowed()
91    executable(
92        'intelcpusensor',
93        'IntelCPUSensorMain.cpp',
94        'IntelCPUSensor.cpp',
95        dependencies: [
96            default_deps,
97            gpiodcxx,
98            thresholds_dep,
99            utils_dep,
100            peci_dep,
101        ],
102        include_directories: peci_incdirs,
103        install: true,
104    )
105endif
106
107if get_option('exit-air').allowed()
108    executable(
109        'exitairtempsensor',
110        'ExitAirTempSensor.cpp',
111        dependencies: [
112            default_deps,
113            thresholds_dep,
114            utils_dep,
115        ],
116        install: true,
117    )
118endif
119
120if get_option('fan').allowed()
121    executable(
122        'fansensor',
123        'FanMain.cpp',
124        'PresenceGpio.cpp',
125        'TachSensor.cpp',
126        'PwmSensor.cpp',
127        dependencies: [
128            default_deps,
129            gpiodcxx,
130            thresholds_dep,
131            utils_dep,
132        ],
133        install: true,
134    )
135endif
136
137if get_option('hwmon-temp').allowed()
138    executable(
139        'hwmontempsensor',
140        'HwmonTempMain.cpp',
141        'HwmonTempSensor.cpp',
142        dependencies: [
143            default_deps,
144            devicemgmt_dep,
145            thresholds_dep,
146            utils_dep,
147        ],
148        install: true,
149    )
150endif
151
152if get_option('intrusion').allowed()
153    executable(
154        'intrusionsensor',
155        'ChassisIntrusionSensor.cpp',
156        'IntrusionSensorMain.cpp',
157        dependencies: [
158            default_deps,
159            gpiodcxx,
160            i2c,
161            utils_dep,
162        ],
163        install: true,
164    )
165endif
166
167if get_option('ipmb').allowed()
168    executable(
169        'ipmbsensor',
170        'IpmbSensorMain.cpp',
171        'IpmbSensor.cpp',
172        'IpmbSDRSensor.cpp',
173        dependencies: [
174            default_deps,
175            thresholds_dep,
176            utils_dep,
177        ],
178        install: true,
179    )
180endif
181
182if get_option('mcu').allowed()
183    executable(
184        'mcutempsensor',
185        'MCUTempSensor.cpp',
186        dependencies: [
187            default_deps,
188            i2c,
189            thresholds_dep,
190            utils_dep,
191        ],
192        install: true,
193    )
194endif
195
196if get_option('nvme').allowed()
197    nvme_srcs = files('NVMeSensor.cpp', 'NVMeSensorMain.cpp')
198    nvme_srcs += files('NVMeBasicContext.cpp')
199
200    nvme_deps = [default_deps, i2c, thresholds_dep, utils_dep, threads]
201
202    executable(
203        'nvmesensor',
204        sources: nvme_srcs,
205        dependencies: nvme_deps,
206        install: true,
207    )
208endif
209
210if get_option('psu').allowed()
211    executable(
212        'psusensor',
213        'PSUEvent.cpp',
214        'PSUSensor.cpp',
215        'PSUSensorMain.cpp',
216        dependencies: [
217            default_deps,
218            devicemgmt_dep,
219            pwmsensor_dep,
220            thresholds_dep,
221            utils_dep,
222        ],
223        install: true,
224    )
225endif
226
227if get_option('external').allowed()
228    executable(
229        'externalsensor',
230        'ExternalSensor.cpp',
231        'ExternalSensorMain.cpp',
232        dependencies: [
233            default_deps,
234            thresholds_dep,
235            utils_dep,
236        ],
237        install: true,
238    )
239endif
240