xref: /openbmc/dbus-sensors/meson.build (revision eee7b429892b84beb87241422453ecd1f9c1c028)
1project(
2    'dbus-sensors',
3    'cpp',
4    default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
5    license: 'Apache-2.0',
6    version: '0.1',
7    meson_version: '>=1.1.1',
8)
9
10# Enable io_uring for all daemons with below flags.
11#    '-DBOOST_ASIO_HAS_IO_URING',
12#    '-DBOOST_ASIO_DISABLE_EPOLL',
13# Note, there is currently an issue with CPUSensor when used in
14# conjunction with io_uring. So it has not been changed to use
15# random file access. But we'd like to enable it for all daemons.
16# https://github.com/openbmc/dbus-sensors/issues/19
17
18add_project_arguments(
19    '-Wno-psabi',
20    '-Wuninitialized',
21    '-DBOOST_SYSTEM_NO_DEPRECATED',
22    '-DBOOST_ASIO_NO_DEPRECATED',
23    '-DBOOST_ERROR_CODE_HEADER_ONLY',
24    '-DBOOST_NO_RTTI',
25    '-DBOOST_NO_TYPEID',
26    '-DBOOST_ALL_NO_LIB',
27    '-DBOOST_ASIO_DISABLE_THREADS',
28    '-DBOOST_ALLOW_DEPRECATED_HEADERS',
29    '-DBOOST_ASIO_HAS_IO_URING',
30    '-DBOOST_ASIO_DISABLE_EPOLL',
31    language: 'cpp',
32)
33
34threads = dependency('threads')
35# i2c-tools doesn't ship a pkg-config file for libi2c
36i2c = meson.get_compiler('cpp').find_library('i2c')
37uring = dependency('liburing', include_type: 'system')
38nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
39gpiodcxx = dependency('libgpiodcxx', default_options: ['bindings=cxx'])
40boost = dependency(
41    'boost',
42    version: '>=1.88.0',
43    include_type: 'system',
44    fallback: 'boost-meson',
45)
46sdbusplus = dependency('sdbusplus')
47phosphor_logging_dep = dependency('phosphor-logging')
48
49default_deps = [
50    boost,
51    nlohmann_json_dep,
52    phosphor_logging_dep,
53    sdbusplus,
54    uring,
55]
56
57subdir('service_files')
58subdir('src')
59