xref: /openbmc/dbus-sensors/src/meson.build (revision 5bc307fb)
1e73bd0a1SAndrew Jefferyconf_data = configuration_data()
2*5bc307fbSPatrick Williamsconf_data.set10('VALIDATION_UNSECURE_FEATURE', get_option('validate-unsecure-feature').allowed())
3*5bc307fbSPatrick Williamsconf_data.set10('INSECURE_UNRESTRICTED_SENSOR_OVERRIDE', get_option('insecure-sensor-override').allowed())
4e73bd0a1SAndrew Jefferyconfigure_file(input: 'dbus-sensor_config.h.in',
5e73bd0a1SAndrew Jeffery               output: 'dbus-sensor_config.h',
6e73bd0a1SAndrew Jeffery               configuration: conf_data)
7e73bd0a1SAndrew Jeffery
8e73bd0a1SAndrew Jefferythresholds_a = static_library(
9e73bd0a1SAndrew Jeffery    'thresholds_a',
10e73bd0a1SAndrew Jeffery    'Thresholds.cpp',
11e73bd0a1SAndrew Jeffery    dependencies: default_deps,
12e73bd0a1SAndrew Jeffery)
13e73bd0a1SAndrew Jeffery
14e73bd0a1SAndrew Jefferythresholds_dep = declare_dependency(
15e73bd0a1SAndrew Jeffery    link_with: [ thresholds_a ],
16e73bd0a1SAndrew Jeffery    dependencies: default_deps,
17e73bd0a1SAndrew Jeffery)
18e73bd0a1SAndrew Jeffery
19e73bd0a1SAndrew Jefferyutils_a = static_library(
20e73bd0a1SAndrew Jeffery    'utils_a',
21e73bd0a1SAndrew Jeffery    [
22e73bd0a1SAndrew Jeffery        'FileHandle.cpp',
23e73bd0a1SAndrew Jeffery        'SensorPaths.cpp',
24e73bd0a1SAndrew Jeffery        'Utils.cpp',
25e73bd0a1SAndrew Jeffery    ],
26e73bd0a1SAndrew Jeffery    dependencies: default_deps,
27e73bd0a1SAndrew Jeffery)
28e73bd0a1SAndrew Jeffery
29e73bd0a1SAndrew Jefferyutils_dep = declare_dependency(
30e73bd0a1SAndrew Jeffery    link_with: [ utils_a ],
31e73bd0a1SAndrew Jeffery    dependencies: [ sdbusplus ],
32e73bd0a1SAndrew Jeffery)
33e73bd0a1SAndrew Jeffery
34e73bd0a1SAndrew Jefferydevicemgmt_a = static_library(
35e73bd0a1SAndrew Jeffery    'devicemgmt_a',
36e73bd0a1SAndrew Jeffery    [
37e73bd0a1SAndrew Jeffery        'DeviceMgmt.cpp',
38e73bd0a1SAndrew Jeffery    ],
39e73bd0a1SAndrew Jeffery    dependencies: default_deps,
40e73bd0a1SAndrew Jeffery)
41e73bd0a1SAndrew Jeffery
42e73bd0a1SAndrew Jefferydevicemgmt_dep = declare_dependency(
43e73bd0a1SAndrew Jeffery    link_with: [ devicemgmt_a ],
44e73bd0a1SAndrew Jeffery    dependencies: default_deps,
45e73bd0a1SAndrew Jeffery)
46e73bd0a1SAndrew Jeffery
47e73bd0a1SAndrew Jefferypwmsensor_a = static_library(
48e73bd0a1SAndrew Jeffery    'pwmsensor_a',
49e73bd0a1SAndrew Jeffery    'PwmSensor.cpp',
50e73bd0a1SAndrew Jeffery    dependencies: [ default_deps, thresholds_dep ],
51e73bd0a1SAndrew Jeffery)
52e73bd0a1SAndrew Jeffery
53e73bd0a1SAndrew Jefferypwmsensor_dep = declare_dependency(
54e73bd0a1SAndrew Jeffery    link_with: [ pwmsensor_a ],
55e73bd0a1SAndrew Jeffery    dependencies: [ default_deps, thresholds_dep ],
56e73bd0a1SAndrew Jeffery)
57e73bd0a1SAndrew Jeffery
58feb19ef0SBrad Bishoppeci_incdirs = []
59feb19ef0SBrad Bishopif not meson.get_compiler('cpp').has_header('linux/peci-ioctl.h')
60feb19ef0SBrad Bishop    peci_incdirs = ['../include']
61feb19ef0SBrad Bishopendif
62feb19ef0SBrad Bishop
63*5bc307fbSPatrick Williamsif get_option('intel-cpu').allowed()
64934d37d8SEd Tanous    peci_dep = dependency('libpeci', required : true)
6577141acbSOleksandr Shulzhenkoendif
6677141acbSOleksandr Shulzhenko
67*5bc307fbSPatrick Williamsif get_option('adc').allowed()
68feb19ef0SBrad Bishop    executable(
69feb19ef0SBrad Bishop        'adcsensor',
70feb19ef0SBrad Bishop        'ADCSensor.cpp',
71feb19ef0SBrad Bishop        'ADCSensorMain.cpp',
72feb19ef0SBrad Bishop        dependencies: [
73302a61a5SPatrick Williams            default_deps,
74feb19ef0SBrad Bishop            gpiodcxx,
758b8f606fSPatrick Williams            thresholds_dep,
768b8f606fSPatrick Williams            utils_dep,
77feb19ef0SBrad Bishop        ],
78feb19ef0SBrad Bishop        install: true,
79feb19ef0SBrad Bishop    )
80feb19ef0SBrad Bishopendif
81feb19ef0SBrad Bishop
82*5bc307fbSPatrick Williamsif get_option('intel-cpu').allowed()
83feb19ef0SBrad Bishop    executable(
84255da6b4SThu Nguyen        'intelcpusensor',
85255da6b4SThu Nguyen        'IntelCPUSensorMain.cpp',
86255da6b4SThu Nguyen        'IntelCPUSensor.cpp',
87feb19ef0SBrad Bishop        dependencies: [
88302a61a5SPatrick Williams            default_deps,
89feb19ef0SBrad Bishop            gpiodcxx,
908b8f606fSPatrick Williams            thresholds_dep,
918b8f606fSPatrick Williams            utils_dep,
9277141acbSOleksandr Shulzhenko            peci_dep,
93feb19ef0SBrad Bishop        ],
94e73bd0a1SAndrew Jeffery        include_directories: peci_incdirs,
95feb19ef0SBrad Bishop        install: true,
96feb19ef0SBrad Bishop    )
97feb19ef0SBrad Bishopendif
98feb19ef0SBrad Bishop
99*5bc307fbSPatrick Williamsif get_option('exit-air').allowed()
100feb19ef0SBrad Bishop    executable(
101feb19ef0SBrad Bishop        'exitairtempsensor',
102feb19ef0SBrad Bishop        'ExitAirTempSensor.cpp',
103feb19ef0SBrad Bishop        dependencies: [
104302a61a5SPatrick Williams            default_deps,
1058b8f606fSPatrick Williams            thresholds_dep,
1068b8f606fSPatrick Williams            utils_dep,
107feb19ef0SBrad Bishop        ],
108feb19ef0SBrad Bishop        install: true,
109feb19ef0SBrad Bishop    )
110feb19ef0SBrad Bishopendif
111feb19ef0SBrad Bishop
112*5bc307fbSPatrick Williamsif get_option('fan').allowed()
113feb19ef0SBrad Bishop    executable(
114feb19ef0SBrad Bishop        'fansensor',
115feb19ef0SBrad Bishop        'FanMain.cpp',
116feb19ef0SBrad Bishop        'TachSensor.cpp',
117feb19ef0SBrad Bishop        'PwmSensor.cpp',
118feb19ef0SBrad Bishop        dependencies: [
119302a61a5SPatrick Williams            default_deps,
1208b8f606fSPatrick Williams            gpiodcxx,
1218b8f606fSPatrick Williams            thresholds_dep,
1228b8f606fSPatrick Williams            utils_dep,
123feb19ef0SBrad Bishop        ],
124feb19ef0SBrad Bishop        install: true,
125feb19ef0SBrad Bishop    )
126feb19ef0SBrad Bishopendif
127feb19ef0SBrad Bishop
128*5bc307fbSPatrick Williamsif get_option('hwmon-temp').allowed()
129feb19ef0SBrad Bishop    executable(
130feb19ef0SBrad Bishop        'hwmontempsensor',
131feb19ef0SBrad Bishop        'HwmonTempMain.cpp',
132feb19ef0SBrad Bishop        'HwmonTempSensor.cpp',
133feb19ef0SBrad Bishop        dependencies: [
134302a61a5SPatrick Williams            default_deps,
135a1456c4aSZev Weiss            devicemgmt_dep,
1368b8f606fSPatrick Williams            thresholds_dep,
1378b8f606fSPatrick Williams            utils_dep,
138feb19ef0SBrad Bishop        ],
139feb19ef0SBrad Bishop        install: true,
140feb19ef0SBrad Bishop    )
141feb19ef0SBrad Bishopendif
142feb19ef0SBrad Bishop
143*5bc307fbSPatrick Williamsif get_option('intrusion').allowed()
144feb19ef0SBrad Bishop    executable(
145feb19ef0SBrad Bishop        'intrusionsensor',
146feb19ef0SBrad Bishop        'ChassisIntrusionSensor.cpp',
147feb19ef0SBrad Bishop        'IntrusionSensorMain.cpp',
148feb19ef0SBrad Bishop        dependencies: [
149302a61a5SPatrick Williams            default_deps,
1508b8f606fSPatrick Williams            gpiodcxx,
151feb19ef0SBrad Bishop            i2c,
1528b8f606fSPatrick Williams            utils_dep,
153feb19ef0SBrad Bishop        ],
154feb19ef0SBrad Bishop        install: true,
155feb19ef0SBrad Bishop    )
156feb19ef0SBrad Bishopendif
157feb19ef0SBrad Bishop
158*5bc307fbSPatrick Williamsif get_option('ipmb').allowed()
159feb19ef0SBrad Bishop    executable(
160feb19ef0SBrad Bishop        'ipmbsensor',
161feb19ef0SBrad Bishop        'IpmbSensor.cpp',
1623746c553SJayashree Dhanapal        'IpmbSDRSensor.cpp',
163feb19ef0SBrad Bishop        dependencies: [
164302a61a5SPatrick Williams            default_deps,
1658b8f606fSPatrick Williams            thresholds_dep,
1668b8f606fSPatrick Williams            utils_dep,
167feb19ef0SBrad Bishop        ],
168feb19ef0SBrad Bishop        install: true,
169feb19ef0SBrad Bishop    )
170feb19ef0SBrad Bishopendif
171feb19ef0SBrad Bishop
172*5bc307fbSPatrick Williamsif get_option('mcu').allowed()
173feb19ef0SBrad Bishop    executable(
174feb19ef0SBrad Bishop        'mcutempsensor',
175feb19ef0SBrad Bishop        'MCUTempSensor.cpp',
176feb19ef0SBrad Bishop        dependencies: [
177302a61a5SPatrick Williams            default_deps,
178feb19ef0SBrad Bishop            i2c,
1798b8f606fSPatrick Williams            thresholds_dep,
1808b8f606fSPatrick Williams            utils_dep,
181feb19ef0SBrad Bishop        ],
182feb19ef0SBrad Bishop        install: true,
183feb19ef0SBrad Bishop    )
184feb19ef0SBrad Bishopendif
185feb19ef0SBrad Bishop
186*5bc307fbSPatrick Williamsif get_option('nvme').allowed()
187e3e3c97aSAndrew Jeffery    nvme_srcs = files('NVMeSensorMain.cpp', 'NVMeSensor.cpp')
188e3e3c97aSAndrew Jeffery    nvme_srcs += files('NVMeBasicContext.cpp')
189e3e3c97aSAndrew Jeffery
1906f25e7e0SAndrew Jeffery    nvme_deps = [ default_deps, i2c, thresholds_dep, utils_dep, threads ]
1916f25e7e0SAndrew Jeffery
192feb19ef0SBrad Bishop    executable(
193feb19ef0SBrad Bishop        'nvmesensor',
194e3e3c97aSAndrew Jeffery        sources: nvme_srcs,
195e3e3c97aSAndrew Jeffery        dependencies: nvme_deps,
196feb19ef0SBrad Bishop        install: true,
197feb19ef0SBrad Bishop    )
198feb19ef0SBrad Bishopendif
199feb19ef0SBrad Bishop
200*5bc307fbSPatrick Williamsif get_option('psu').allowed()
201feb19ef0SBrad Bishop    executable(
2023a18b860SLei YU        'psusensor',
203feb19ef0SBrad Bishop        'PSUEvent.cpp',
204feb19ef0SBrad Bishop        'PSUSensor.cpp',
205feb19ef0SBrad Bishop        'PSUSensorMain.cpp',
206feb19ef0SBrad Bishop        dependencies: [
207302a61a5SPatrick Williams            default_deps,
208786efb80SMatt Simmering            devicemgmt_dep,
2098b8f606fSPatrick Williams            pwmsensor_dep,
2108b8f606fSPatrick Williams            thresholds_dep,
2118b8f606fSPatrick Williams            utils_dep,
212feb19ef0SBrad Bishop        ],
213feb19ef0SBrad Bishop        install: true,
214feb19ef0SBrad Bishop    )
215feb19ef0SBrad Bishopendif
216feb19ef0SBrad Bishop
217*5bc307fbSPatrick Williamsif get_option('external').allowed()
218feb19ef0SBrad Bishop    executable(
219feb19ef0SBrad Bishop        'externalsensor',
220feb19ef0SBrad Bishop        'ExternalSensor.cpp',
221feb19ef0SBrad Bishop        'ExternalSensorMain.cpp',
222feb19ef0SBrad Bishop        dependencies: [
223302a61a5SPatrick Williams            default_deps,
2248b8f606fSPatrick Williams            thresholds_dep,
2258b8f606fSPatrick Williams            utils_dep,
226feb19ef0SBrad Bishop        ],
227feb19ef0SBrad Bishop        install: true,
228feb19ef0SBrad Bishop    )
229feb19ef0SBrad Bishopendif
230