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