xref: /openbmc/dbus-sensors/src/meson.build (revision ab8b045e)
1e73bd0a1SAndrew Jefferyconf_data = configuration_data()
2*ab8b045eSAndrew Jefferyconf_data.set10(
3*ab8b045eSAndrew Jeffery    'VALIDATION_UNSECURE_FEATURE',
4*ab8b045eSAndrew Jeffery    get_option('validate-unsecure-feature').allowed(),
5*ab8b045eSAndrew Jeffery)
6*ab8b045eSAndrew Jefferyconf_data.set10(
7*ab8b045eSAndrew Jeffery    'INSECURE_UNRESTRICTED_SENSOR_OVERRIDE',
8*ab8b045eSAndrew Jeffery    get_option('insecure-sensor-override').allowed(),
9*ab8b045eSAndrew Jeffery)
10*ab8b045eSAndrew Jefferyconfigure_file(
11*ab8b045eSAndrew Jeffery    input: 'dbus-sensor_config.h.in',
12e73bd0a1SAndrew Jeffery    output: 'dbus-sensor_config.h',
13*ab8b045eSAndrew Jeffery    configuration: conf_data,
14*ab8b045eSAndrew 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',
169feb19ef0SBrad Bishop        'IpmbSensor.cpp',
1703746c553SJayashree Dhanapal        'IpmbSDRSensor.cpp',
171feb19ef0SBrad Bishop        dependencies: [
172302a61a5SPatrick Williams            default_deps,
1738b8f606fSPatrick Williams            thresholds_dep,
1748b8f606fSPatrick Williams            utils_dep,
175feb19ef0SBrad Bishop        ],
176feb19ef0SBrad Bishop        install: true,
177feb19ef0SBrad Bishop    )
178feb19ef0SBrad Bishopendif
179feb19ef0SBrad Bishop
1805bc307fbSPatrick Williamsif get_option('mcu').allowed()
181feb19ef0SBrad Bishop    executable(
182feb19ef0SBrad Bishop        'mcutempsensor',
183feb19ef0SBrad Bishop        'MCUTempSensor.cpp',
184feb19ef0SBrad Bishop        dependencies: [
185302a61a5SPatrick Williams            default_deps,
186feb19ef0SBrad Bishop            i2c,
1878b8f606fSPatrick Williams            thresholds_dep,
1888b8f606fSPatrick Williams            utils_dep,
189feb19ef0SBrad Bishop        ],
190feb19ef0SBrad Bishop        install: true,
191feb19ef0SBrad Bishop    )
192feb19ef0SBrad Bishopendif
193feb19ef0SBrad Bishop
1945bc307fbSPatrick Williamsif get_option('nvme').allowed()
195*ab8b045eSAndrew Jeffery    nvme_srcs = files('NVMeSensor.cpp', 'NVMeSensorMain.cpp')
196e3e3c97aSAndrew Jeffery    nvme_srcs += files('NVMeBasicContext.cpp')
197e3e3c97aSAndrew Jeffery
1986f25e7e0SAndrew Jeffery    nvme_deps = [default_deps, i2c, thresholds_dep, utils_dep, threads]
1996f25e7e0SAndrew Jeffery
200feb19ef0SBrad Bishop    executable(
201feb19ef0SBrad Bishop        'nvmesensor',
202e3e3c97aSAndrew Jeffery        sources: nvme_srcs,
203e3e3c97aSAndrew Jeffery        dependencies: nvme_deps,
204feb19ef0SBrad Bishop        install: true,
205feb19ef0SBrad Bishop    )
206feb19ef0SBrad Bishopendif
207feb19ef0SBrad Bishop
2085bc307fbSPatrick Williamsif get_option('psu').allowed()
209feb19ef0SBrad Bishop    executable(
2103a18b860SLei YU        'psusensor',
211feb19ef0SBrad Bishop        'PSUEvent.cpp',
212feb19ef0SBrad Bishop        'PSUSensor.cpp',
213feb19ef0SBrad Bishop        'PSUSensorMain.cpp',
214feb19ef0SBrad Bishop        dependencies: [
215302a61a5SPatrick Williams            default_deps,
216786efb80SMatt Simmering            devicemgmt_dep,
2178b8f606fSPatrick Williams            pwmsensor_dep,
2188b8f606fSPatrick Williams            thresholds_dep,
2198b8f606fSPatrick Williams            utils_dep,
220feb19ef0SBrad Bishop        ],
221feb19ef0SBrad Bishop        install: true,
222feb19ef0SBrad Bishop    )
223feb19ef0SBrad Bishopendif
224feb19ef0SBrad Bishop
2255bc307fbSPatrick Williamsif get_option('external').allowed()
226feb19ef0SBrad Bishop    executable(
227feb19ef0SBrad Bishop        'externalsensor',
228feb19ef0SBrad Bishop        'ExternalSensor.cpp',
229feb19ef0SBrad Bishop        'ExternalSensorMain.cpp',
230feb19ef0SBrad Bishop        dependencies: [
231302a61a5SPatrick Williams            default_deps,
2328b8f606fSPatrick Williams            thresholds_dep,
2338b8f606fSPatrick Williams            utils_dep,
234feb19ef0SBrad Bishop        ],
235feb19ef0SBrad Bishop        install: true,
236feb19ef0SBrad Bishop    )
237feb19ef0SBrad Bishopendif
238