xref: /openbmc/sdbusplus/example/meson.build (revision ea56ec3c)
1executable(
2    'list-users',
3    'list-users.cpp',
4    dependencies: sdbusplus_dep,
5)
6
7has_asio = meson.get_compiler('cpp').has_header_symbol(
8  'boost/asio.hpp',
9  'boost::asio::io_context',
10  required: false)
11asio_dep = sdbusplus_dep
12if not has_asio
13  asio_dep = disabler()
14endif
15
16assert(
17    not get_option('examples').enabled() or has_asio,
18    'Boost is required when examples are enabled'
19)
20
21executable(
22    'asio-example',
23    'asio-example.cpp',
24    dependencies: [
25        asio_dep,
26        dependency(
27            'boost',
28            modules: ['coroutine', 'context'],
29            disabler: true,
30            required: false,
31        ),
32    ],
33)
34
35executable(
36    'register-property',
37    'register-property.cpp',
38    dependencies: asio_dep,
39)
40
41executable(
42    'get-all-properties',
43    'get-all-properties.cpp',
44    dependencies: asio_dep,
45)
46
47calc_buildroot = meson.current_build_dir()
48calc_files = files(
49    run_command(
50        sdbusgen_prog,
51        '--tool', sdbusplusplus_prog,
52        '--output', calc_buildroot,
53        'net',
54        check: true
55    ).stdout().strip().split('\n')
56)
57
58executable(
59    'calculator-server',
60    'calculator-server.cpp',
61    calc_files,
62    dependencies: sdbusplus_dep,
63)
64