xref: /openbmc/dbus-sensors/src/meson.build (revision 828c5a6e)
1e73bd0a1SAndrew Jefferyconf_data = configuration_data()
2ab8b045eSAndrew Jefferyconf_data.set10(
3ab8b045eSAndrew Jeffery    'VALIDATION_UNSECURE_FEATURE',
4ab8b045eSAndrew Jeffery    get_option('validate-unsecure-feature').allowed(),
5ab8b045eSAndrew Jeffery)
6ab8b045eSAndrew Jefferyconf_data.set10(
7ab8b045eSAndrew Jeffery    'INSECURE_UNRESTRICTED_SENSOR_OVERRIDE',
8ab8b045eSAndrew Jeffery    get_option('insecure-sensor-override').allowed(),
9ab8b045eSAndrew Jeffery)
10ab8b045eSAndrew Jefferyconfigure_file(
11ab8b045eSAndrew Jeffery    input: 'dbus-sensor_config.h.in',
12e73bd0a1SAndrew Jeffery    output: 'dbus-sensor_config.h',
13ab8b045eSAndrew Jeffery    configuration: conf_data,
14ab8b045eSAndrew Jeffery)
15e73bd0a1SAndrew Jeffery
16e73bd0a1SAndrew Jefferythresholds_a = static_library(
17e73bd0a1SAndrew Jeffery    'thresholds_a',
18e73bd0a1SAndrew Jeffery    'Thresholds.cpp',
19e73bd0a1SAndrew Jeffery    dependencies: default_deps,
20e73bd0a1SAndrew Jeffery)
21e73bd0a1SAndrew Jeffery
22e73bd0a1SAndrew Jefferythresholds_dep = declare_dependency(
23e73bd0a1SAndrew Jeffery    link_with: [thresholds_a],
24e73bd0a1SAndrew Jeffery    dependencies: default_deps,
25e73bd0a1SAndrew Jeffery)
26e73bd0a1SAndrew Jeffery
27e73bd0a1SAndrew Jefferyutils_a = static_library(
28e73bd0a1SAndrew Jeffery    'utils_a',
29e73bd0a1SAndrew Jeffery    [
30e73bd0a1SAndrew Jeffery        'FileHandle.cpp',
31e73bd0a1SAndrew Jeffery        'SensorPaths.cpp',
32e73bd0a1SAndrew Jeffery        'Utils.cpp',
33e73bd0a1SAndrew Jeffery    ],
34e73bd0a1SAndrew Jeffery    dependencies: default_deps,
35e73bd0a1SAndrew Jeffery)
36e73bd0a1SAndrew Jeffery
37e73bd0a1SAndrew Jefferyutils_dep = declare_dependency(
38e73bd0a1SAndrew Jeffery    link_with: [utils_a],
39e73bd0a1SAndrew Jeffery    dependencies: [sdbusplus],
40e73bd0a1SAndrew Jeffery)
41e73bd0a1SAndrew Jeffery
42e73bd0a1SAndrew Jefferydevicemgmt_a = static_library(
43e73bd0a1SAndrew Jeffery    'devicemgmt_a',
44e73bd0a1SAndrew Jeffery    [
45e73bd0a1SAndrew Jeffery        'DeviceMgmt.cpp',
46e73bd0a1SAndrew Jeffery    ],
47e73bd0a1SAndrew Jeffery    dependencies: default_deps,
48e73bd0a1SAndrew Jeffery)
49e73bd0a1SAndrew Jeffery
50e73bd0a1SAndrew Jefferydevicemgmt_dep = declare_dependency(
51e73bd0a1SAndrew Jeffery    link_with: [devicemgmt_a],
52e73bd0a1SAndrew Jeffery    dependencies: default_deps,
53e73bd0a1SAndrew Jeffery)
54e73bd0a1SAndrew Jeffery
55e73bd0a1SAndrew Jefferypwmsensor_a = static_library(
56e73bd0a1SAndrew Jeffery    'pwmsensor_a',
57e73bd0a1SAndrew Jeffery    'PwmSensor.cpp',
58e73bd0a1SAndrew Jeffery    dependencies: [default_deps, thresholds_dep],
59e73bd0a1SAndrew Jeffery)
60e73bd0a1SAndrew Jeffery
61e73bd0a1SAndrew Jefferypwmsensor_dep = declare_dependency(
62e73bd0a1SAndrew Jeffery    link_with: [pwmsensor_a],
63e73bd0a1SAndrew Jeffery    dependencies: [default_deps, thresholds_dep],
64e73bd0a1SAndrew Jeffery)
65e73bd0a1SAndrew Jeffery
66feb19ef0SBrad Bishoppeci_incdirs = []
67feb19ef0SBrad Bishopif not meson.get_compiler('cpp').has_header('linux/peci-ioctl.h')
68feb19ef0SBrad Bishop    peci_incdirs = ['../include']
69feb19ef0SBrad Bishopendif
70feb19ef0SBrad Bishop
715bc307fbSPatrick Williamsif get_option('intel-cpu').allowed()
72934d37d8SEd Tanous    peci_dep = dependency('libpeci', required: true)
7377141acbSOleksandr Shulzhenkoendif
7477141acbSOleksandr Shulzhenko
755bc307fbSPatrick Williamsif get_option('adc').allowed()
76feb19ef0SBrad Bishop    executable(
77feb19ef0SBrad Bishop        'adcsensor',
78feb19ef0SBrad Bishop        'ADCSensor.cpp',
79feb19ef0SBrad Bishop        'ADCSensorMain.cpp',
80feb19ef0SBrad Bishop        dependencies: [
81302a61a5SPatrick Williams            default_deps,
82feb19ef0SBrad Bishop            gpiodcxx,
838b8f606fSPatrick Williams            thresholds_dep,
848b8f606fSPatrick Williams            utils_dep,
85feb19ef0SBrad Bishop        ],
86feb19ef0SBrad Bishop        install: true,
87feb19ef0SBrad Bishop    )
88feb19ef0SBrad Bishopendif
89feb19ef0SBrad Bishop
905bc307fbSPatrick Williamsif get_option('intel-cpu').allowed()
91feb19ef0SBrad Bishop    executable(
92255da6b4SThu Nguyen        'intelcpusensor',
93255da6b4SThu Nguyen        'IntelCPUSensorMain.cpp',
94255da6b4SThu Nguyen        'IntelCPUSensor.cpp',
95feb19ef0SBrad Bishop        dependencies: [
96302a61a5SPatrick Williams            default_deps,
97feb19ef0SBrad Bishop            gpiodcxx,
988b8f606fSPatrick Williams            thresholds_dep,
998b8f606fSPatrick Williams            utils_dep,
10077141acbSOleksandr Shulzhenko            peci_dep,
101feb19ef0SBrad Bishop        ],
102e73bd0a1SAndrew Jeffery        include_directories: peci_incdirs,
103feb19ef0SBrad Bishop        install: true,
104feb19ef0SBrad Bishop    )
105feb19ef0SBrad Bishopendif
106feb19ef0SBrad Bishop
1075bc307fbSPatrick Williamsif get_option('exit-air').allowed()
108feb19ef0SBrad Bishop    executable(
109feb19ef0SBrad Bishop        'exitairtempsensor',
110feb19ef0SBrad Bishop        'ExitAirTempSensor.cpp',
111feb19ef0SBrad Bishop        dependencies: [
112302a61a5SPatrick Williams            default_deps,
1138b8f606fSPatrick Williams            thresholds_dep,
1148b8f606fSPatrick Williams            utils_dep,
115feb19ef0SBrad Bishop        ],
116feb19ef0SBrad Bishop        install: true,
117feb19ef0SBrad Bishop    )
118feb19ef0SBrad Bishopendif
119feb19ef0SBrad Bishop
1205bc307fbSPatrick Williamsif get_option('fan').allowed()
121feb19ef0SBrad Bishop    executable(
122feb19ef0SBrad Bishop        'fansensor',
123feb19ef0SBrad Bishop        'FanMain.cpp',
124feb19ef0SBrad Bishop        'TachSensor.cpp',
125feb19ef0SBrad Bishop        'PwmSensor.cpp',
126feb19ef0SBrad Bishop        dependencies: [
127302a61a5SPatrick Williams            default_deps,
1288b8f606fSPatrick Williams            gpiodcxx,
1298b8f606fSPatrick Williams            thresholds_dep,
1308b8f606fSPatrick Williams            utils_dep,
131feb19ef0SBrad Bishop        ],
132feb19ef0SBrad Bishop        install: true,
133feb19ef0SBrad Bishop    )
134feb19ef0SBrad Bishopendif
135feb19ef0SBrad Bishop
1365bc307fbSPatrick Williamsif get_option('hwmon-temp').allowed()
137feb19ef0SBrad Bishop    executable(
138feb19ef0SBrad Bishop        'hwmontempsensor',
139feb19ef0SBrad Bishop        'HwmonTempMain.cpp',
140feb19ef0SBrad Bishop        'HwmonTempSensor.cpp',
141feb19ef0SBrad Bishop        dependencies: [
142302a61a5SPatrick Williams            default_deps,
143a1456c4aSZev Weiss            devicemgmt_dep,
1448b8f606fSPatrick Williams            thresholds_dep,
1458b8f606fSPatrick Williams            utils_dep,
146feb19ef0SBrad Bishop        ],
147feb19ef0SBrad Bishop        install: true,
148feb19ef0SBrad Bishop    )
149feb19ef0SBrad Bishopendif
150feb19ef0SBrad Bishop
1515bc307fbSPatrick Williamsif get_option('intrusion').allowed()
152feb19ef0SBrad Bishop    executable(
153feb19ef0SBrad Bishop        'intrusionsensor',
154feb19ef0SBrad Bishop        'ChassisIntrusionSensor.cpp',
155feb19ef0SBrad Bishop        'IntrusionSensorMain.cpp',
156feb19ef0SBrad Bishop        dependencies: [
157302a61a5SPatrick Williams            default_deps,
1588b8f606fSPatrick Williams            gpiodcxx,
159feb19ef0SBrad Bishop            i2c,
1608b8f606fSPatrick Williams            utils_dep,
161feb19ef0SBrad Bishop        ],
162feb19ef0SBrad Bishop        install: true,
163feb19ef0SBrad Bishop    )
164feb19ef0SBrad Bishopendif
165feb19ef0SBrad Bishop
1665bc307fbSPatrick Williamsif get_option('ipmb').allowed()
167feb19ef0SBrad Bishop    executable(
168feb19ef0SBrad Bishop        'ipmbsensor',
169*828c5a6eSEd Tanous        'IpmbSensorMain.cpp',
170feb19ef0SBrad Bishop        'IpmbSensor.cpp',
1713746c553SJayashree Dhanapal        'IpmbSDRSensor.cpp',
172feb19ef0SBrad Bishop        dependencies: [
173302a61a5SPatrick Williams            default_deps,
1748b8f606fSPatrick Williams            thresholds_dep,
1758b8f606fSPatrick Williams            utils_dep,
176feb19ef0SBrad Bishop        ],
177feb19ef0SBrad Bishop        install: true,
178feb19ef0SBrad Bishop    )
179feb19ef0SBrad Bishopendif
180feb19ef0SBrad Bishop
1815bc307fbSPatrick Williamsif get_option('mcu').allowed()
182feb19ef0SBrad Bishop    executable(
183feb19ef0SBrad Bishop        'mcutempsensor',
184feb19ef0SBrad Bishop        'MCUTempSensor.cpp',
185feb19ef0SBrad Bishop        dependencies: [
186302a61a5SPatrick Williams            default_deps,
187feb19ef0SBrad Bishop            i2c,
1888b8f606fSPatrick Williams            thresholds_dep,
1898b8f606fSPatrick Williams            utils_dep,
190feb19ef0SBrad Bishop        ],
191feb19ef0SBrad Bishop        install: true,
192feb19ef0SBrad Bishop    )
193feb19ef0SBrad Bishopendif
194feb19ef0SBrad Bishop
1955bc307fbSPatrick Williamsif get_option('nvme').allowed()
196ab8b045eSAndrew Jeffery    nvme_srcs = files('NVMeSensor.cpp', 'NVMeSensorMain.cpp')
197e3e3c97aSAndrew Jeffery    nvme_srcs += files('NVMeBasicContext.cpp')
198e3e3c97aSAndrew Jeffery
1996f25e7e0SAndrew Jeffery    nvme_deps = [default_deps, i2c, thresholds_dep, utils_dep, threads]
2006f25e7e0SAndrew Jeffery
201feb19ef0SBrad Bishop    executable(
202feb19ef0SBrad Bishop        'nvmesensor',
203e3e3c97aSAndrew Jeffery        sources: nvme_srcs,
204e3e3c97aSAndrew Jeffery        dependencies: nvme_deps,
205feb19ef0SBrad Bishop        install: true,
206feb19ef0SBrad Bishop    )
207feb19ef0SBrad Bishopendif
208feb19ef0SBrad Bishop
2095bc307fbSPatrick Williamsif get_option('psu').allowed()
210feb19ef0SBrad Bishop    executable(
2113a18b860SLei YU        'psusensor',
212feb19ef0SBrad Bishop        'PSUEvent.cpp',
213feb19ef0SBrad Bishop        'PSUSensor.cpp',
214feb19ef0SBrad Bishop        'PSUSensorMain.cpp',
215feb19ef0SBrad Bishop        dependencies: [
216302a61a5SPatrick Williams            default_deps,
217786efb80SMatt Simmering            devicemgmt_dep,
2188b8f606fSPatrick Williams            pwmsensor_dep,
2198b8f606fSPatrick Williams            thresholds_dep,
2208b8f606fSPatrick Williams            utils_dep,
221feb19ef0SBrad Bishop        ],
222feb19ef0SBrad Bishop        install: true,
223feb19ef0SBrad Bishop    )
224feb19ef0SBrad Bishopendif
225feb19ef0SBrad Bishop
2265bc307fbSPatrick Williamsif get_option('external').allowed()
227feb19ef0SBrad Bishop    executable(
228feb19ef0SBrad Bishop        'externalsensor',
229feb19ef0SBrad Bishop        'ExternalSensor.cpp',
230feb19ef0SBrad Bishop        'ExternalSensorMain.cpp',
231feb19ef0SBrad Bishop        dependencies: [
232302a61a5SPatrick Williams            default_deps,
2338b8f606fSPatrick Williams            thresholds_dep,
2348b8f606fSPatrick Williams            utils_dep,
235feb19ef0SBrad Bishop        ],
236feb19ef0SBrad Bishop        install: true,
237feb19ef0SBrad Bishop    )
238feb19ef0SBrad Bishopendif
239