xref: /openbmc/dbus-sensors/meson.build (revision 10480779)
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('boost', version: '>=1.83.0', include_type: 'system')
41sdbusplus = dependency('sdbusplus', include_type: 'system')
42phosphor_logging_dep = dependency('phosphor-logging')
43
44default_deps = [
45    boost,
46    nlohmann_json_dep,
47    phosphor_logging_dep,
48    sdbusplus,
49    uring,
50]
51
52subdir('service_files')
53subdir('src')
54
55if not get_option('tests').disabled()
56    subdir('tests')
57endif
58