Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 1 | # Rules for building with Meson |
| 2 | |
| 3 | project( |
| 4 | 'hostlogger', |
| 5 | 'cpp', |
| 6 | default_options: [ |
| 7 | 'warning_level=3', |
| 8 | 'werror=true', |
Patrick Williams | cd21a2a | 2021-10-06 15:35:51 -0500 | [diff] [blame^] | 9 | 'cpp_std=c++20', |
Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 10 | ], |
| 11 | license: 'Apache-2.0', |
Patrick Williams | cd21a2a | 2021-10-06 15:35:51 -0500 | [diff] [blame^] | 12 | meson_version: '>=0.57.0', |
Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 13 | ) |
| 14 | |
| 15 | # version info from git |
| 16 | version = vcs_tag(command: [ 'git', 'describe', '--always', '--dirty', '--long' ], |
| 17 | input: 'src/version.hpp.in', |
| 18 | output: 'version.hpp') |
| 19 | |
| 20 | # unit tests |
| 21 | build_tests = get_option('tests') |
| 22 | subdir('test') |
| 23 | |
| 24 | # install systemd unit template file |
| 25 | systemd = dependency('systemd') |
| 26 | systemd_system_unit_dir = systemd.get_pkgconfig_variable( |
| 27 | 'systemdsystemunitdir', |
| 28 | define_variable: ['prefix', get_option('prefix')], |
| 29 | ) |
| 30 | configure_file( |
| 31 | copy: true, |
| 32 | input: 'hostlogger@.service', |
| 33 | install: true, |
| 34 | install_dir: systemd_system_unit_dir, |
| 35 | output: 'hostlogger@.service' |
| 36 | ) |
| 37 | |
| 38 | executable( |
| 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 Zhou | 042b5ba | 2021-06-18 09:32:45 -0700 | [diff] [blame] | 48 | 'src/buffer_service.cpp', |
| 49 | 'src/stream_service.cpp', |
Artem Senichev | e8837d5 | 2020-06-07 11:59:04 +0300 | [diff] [blame] | 50 | '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 | ) |