xref: /openbmc/sdbusplus/meson.build (revision 98019e74)
1project('sdbusplus', 'cpp', 'c',
2    default_options: [
3      'buildtype=debugoptimized',
4      'cpp_std=c++20',
5      'werror=true',
6      'tests=' + (meson.is_subproject() ? 'disabled' : 'auto'),
7      'examples=' + (meson.is_subproject() ? 'disabled' : 'auto'),
8    ],
9    version: '1.0.0',
10    meson_version: '>=0.57.0',
11)
12
13libsystemd_pkg = dependency('libsystemd')
14root_inc = include_directories('include')
15
16libsdbusplus_src = files(
17    'src/exception.cpp',
18    'src/bus.cpp',
19    'src/message/native_types.cpp',
20    'src/sdbus.cpp',
21    'src/server/interface.cpp',
22    'src/server/transaction.cpp',
23)
24
25libsdbusplus = library(
26    'sdbusplus',
27    libsdbusplus_src,
28    include_directories: root_inc,
29    dependencies: libsystemd_pkg,
30    version: meson.project_version(),
31    install: true,
32)
33
34sdbusplus_dep = declare_dependency(
35    include_directories: root_inc,
36    link_with: libsdbusplus,
37    dependencies: libsystemd_pkg
38)
39
40subdir('tools')
41
42boost_dep = dependency(
43    'boost',
44    disabler: true,
45    required: false,
46    modules: [ 'coroutine', 'context' ],
47)
48
49if not get_option('examples').disabled()
50  subdir('example')
51endif
52if not get_option('tests').disabled()
53  subdir('test')
54endif
55
56install_subdir(
57    'include/sdbusplus',
58    install_dir: get_option('includedir'),
59    strip_directory: false,
60)
61
62import('pkgconfig').generate(
63    libsdbusplus,
64    name: meson.project_name(),
65    version: meson.project_version(),
66    requires: libsystemd_pkg,
67    description: 'C++ bindings for sdbus',
68)
69