xref: /openbmc/sdbusplus/meson.build (revision d9bb33e2)
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/sdbus.cpp',
20    'src/server/interface.cpp',
21    'src/server/transaction.cpp',
22)
23
24libsdbusplus = library(
25    'sdbusplus',
26    libsdbusplus_src,
27    include_directories: root_inc,
28    dependencies: libsystemd_pkg,
29    version: meson.project_version(),
30    install: true,
31)
32
33sdbusplus_dep = declare_dependency(
34    include_directories: root_inc,
35    link_with: libsdbusplus,
36    dependencies: libsystemd_pkg
37)
38
39subdir('tools')
40
41boost_dep = dependency(
42    'boost',
43    disabler: true,
44    required: false,
45    modules: [ 'coroutine', 'context' ],
46)
47
48if not get_option('examples').disabled()
49  subdir('example')
50endif
51if not get_option('tests').disabled()
52  subdir('test')
53endif
54
55install_subdir(
56    'include/sdbusplus',
57    install_dir: get_option('includedir'),
58    strip_directory: false,
59)
60
61import('pkgconfig').generate(
62    libsdbusplus,
63    name: meson.project_name(),
64    version: meson.project_version(),
65    requires: libsystemd_pkg,
66    description: 'C++ bindings for sdbus',
67)
68