blob: ee8ecdb38e9e101fb250a6695e22df40e49bd44a [file] [log] [blame]
Artem Senicheve8837d52020-06-07 11:59:04 +03001# Rules for building with Meson
2
3project(
4 'hostlogger',
5 'cpp',
6 default_options: [
7 'warning_level=3',
8 'werror=true',
9 'cpp_std=c++17',
10 ],
11 license: 'Apache-2.0',
12)
13
14# version info from git
15version = vcs_tag(command: [ 'git', 'describe', '--always', '--dirty', '--long' ],
16 input: 'src/version.hpp.in',
17 output: 'version.hpp')
18
19# unit tests
20build_tests = get_option('tests')
21subdir('test')
22
23# install systemd unit template file
24systemd = dependency('systemd')
25systemd_system_unit_dir = systemd.get_pkgconfig_variable(
26 'systemdsystemunitdir',
27 define_variable: ['prefix', get_option('prefix')],
28)
29configure_file(
30 copy: true,
31 input: 'hostlogger@.service',
32 install: true,
33 install_dir: systemd_system_unit_dir,
34 output: 'hostlogger@.service'
35)
36
37executable(
38 'hostlogger',
39 [
40 version,
41 'src/config.cpp',
42 'src/dbus_loop.cpp',
43 'src/file_storage.cpp',
44 'src/host_console.cpp',
45 'src/log_buffer.cpp',
46 'src/main.cpp',
Nan Zhou042b5ba2021-06-18 09:32:45 -070047 'src/buffer_service.cpp',
48 'src/stream_service.cpp',
Artem Senicheve8837d52020-06-07 11:59:04 +030049 'src/zlib_exception.cpp',
50 'src/zlib_file.cpp',
51 ],
52 dependencies: [
53 systemd,
54 dependency('phosphor-logging'),
55 dependency('zlib'),
56 ],
57 install: true
58)