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