blob: 0f8d6e650f1a7d5b810384b8218acf7ea055b269 [file] [log] [blame]
Artem Senicheve8837d52020-06-07 11:59:04 +03001# Rules for building with Meson
2
3project(
Patrick Williamse0bb03b2025-02-01 08:36:38 -05004 'hostlogger',
5 'cpp',
6 default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
7 license: 'Apache-2.0',
8 meson_version: '>=1.1.1',
Artem Senicheve8837d52020-06-07 11:59:04 +03009)
10
11# version info from git
Patrick Williamse0bb03b2025-02-01 08:36:38 -050012version = vcs_tag(
13 command: ['git', 'describe', '--always', '--dirty', '--long'],
14 input: 'src/version.hpp.in',
15 output: 'version.hpp',
16)
Artem Senicheve8837d52020-06-07 11:59:04 +030017
18# unit tests
19build_tests = get_option('tests')
20subdir('test')
21
22# install systemd unit template file
23systemd = dependency('systemd')
Patrick Williamsc0c87062023-04-12 08:05:09 -050024systemd_system_unit_dir = systemd.get_variable(
Patrick Williamse0bb03b2025-02-01 08:36:38 -050025 'systemdsystemunitdir',
26 pkgconfig_define: ['prefix', get_option('prefix')],
Artem Senicheve8837d52020-06-07 11:59:04 +030027)
28configure_file(
Patrick Williamse0bb03b2025-02-01 08:36:38 -050029 copy: true,
30 input: 'hostlogger@.service',
31 install: true,
32 install_dir: systemd_system_unit_dir,
33 output: 'hostlogger@.service',
Artem Senicheve8837d52020-06-07 11:59:04 +030034)
35
36executable(
Patrick Williamse0bb03b2025-02-01 08:36:38 -050037 'hostlogger',
38 [
39 version,
40 'src/config.cpp',
41 'src/dbus_loop.cpp',
42 'src/file_storage.cpp',
43 'src/host_console.cpp',
44 'src/log_buffer.cpp',
45 'src/main.cpp',
46 'src/buffer_service.cpp',
47 'src/stream_service.cpp',
48 'src/zlib_exception.cpp',
49 'src/zlib_file.cpp',
50 ],
51 dependencies: [
52 dependency('libsystemd'),
53 dependency('phosphor-logging'),
54 dependency('zlib'),
55 ],
56 install: true,
Artem Senicheve8837d52020-06-07 11:59:04 +030057)