blob: dfeb8a871cd3ae270fd87d6860ca4ddf0b31ccaf [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',
Patrick Williamscd21a2a2021-10-06 15:35:51 -05009 'cpp_std=c++20',
Artem Senicheve8837d52020-06-07 11:59:04 +030010 ],
11 license: 'Apache-2.0',
Patrick Williamscd21a2a2021-10-06 15:35:51 -050012 meson_version: '>=0.57.0',
Artem Senicheve8837d52020-06-07 11:59:04 +030013)
14
15# version info from git
16version = vcs_tag(command: [ 'git', 'describe', '--always', '--dirty', '--long' ],
17 input: 'src/version.hpp.in',
18 output: 'version.hpp')
19
20# unit tests
21build_tests = get_option('tests')
22subdir('test')
23
24# install systemd unit template file
25systemd = dependency('systemd')
26systemd_system_unit_dir = systemd.get_pkgconfig_variable(
27 'systemdsystemunitdir',
28 define_variable: ['prefix', get_option('prefix')],
29)
30configure_file(
31 copy: true,
32 input: 'hostlogger@.service',
33 install: true,
34 install_dir: systemd_system_unit_dir,
35 output: 'hostlogger@.service'
36)
37
38executable(
39 'hostlogger',
40 [
41 version,
42 'src/config.cpp',
43 'src/dbus_loop.cpp',
44 'src/file_storage.cpp',
45 'src/host_console.cpp',
46 'src/log_buffer.cpp',
47 'src/main.cpp',
Nan Zhou042b5ba2021-06-18 09:32:45 -070048 'src/buffer_service.cpp',
49 'src/stream_service.cpp',
Artem Senicheve8837d52020-06-07 11:59:04 +030050 'src/zlib_exception.cpp',
51 'src/zlib_file.cpp',
52 ],
53 dependencies: [
54 systemd,
55 dependency('phosphor-logging'),
56 dependency('zlib'),
57 ],
58 install: true
59)