Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 1 | # Rules for building with Meson |
| 2 | |
| 3 | project( |
Patrick Williams | e0bb03b | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 4 | '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 Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 9 | ) |
| 10 | |
| 11 | # version info from git |
Patrick Williams | e0bb03b | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 12 | version = vcs_tag( |
| 13 | command: ['git', 'describe', '--always', '--dirty', '--long'], |
| 14 | input: 'src/version.hpp.in', |
| 15 | output: 'version.hpp', |
| 16 | ) |
Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 17 | |
| 18 | # unit tests |
| 19 | build_tests = get_option('tests') |
| 20 | subdir('test') |
| 21 | |
| 22 | # install systemd unit template file |
| 23 | systemd = dependency('systemd') |
Patrick Williams | c0c8706 | 2023-04-12 08:05:09 -0500 | [diff] [blame] | 24 | systemd_system_unit_dir = systemd.get_variable( |
Patrick Williams | e0bb03b | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 25 | 'systemdsystemunitdir', |
| 26 | pkgconfig_define: ['prefix', get_option('prefix')], |
Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 27 | ) |
| 28 | configure_file( |
Patrick Williams | e0bb03b | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 29 | copy: true, |
| 30 | input: 'hostlogger@.service', |
| 31 | install: true, |
| 32 | install_dir: systemd_system_unit_dir, |
| 33 | output: 'hostlogger@.service', |
Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 34 | ) |
| 35 | |
| 36 | executable( |
Patrick Williams | e0bb03b | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 37 | '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 Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 57 | ) |