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', |
| 9 | 'cpp_std=c++17', |
| 10 | ], |
| 11 | license: 'Apache-2.0', |
| 12 | ) |
| 13 | |
| 14 | # version info from git |
| 15 | version = vcs_tag(command: [ 'git', 'describe', '--always', '--dirty', '--long' ], |
| 16 | input: 'src/version.hpp.in', |
| 17 | output: 'version.hpp') |
| 18 | |
| 19 | # unit tests |
| 20 | build_tests = get_option('tests') |
| 21 | subdir('test') |
| 22 | |
| 23 | # install systemd unit template file |
| 24 | systemd = dependency('systemd') |
| 25 | systemd_system_unit_dir = systemd.get_pkgconfig_variable( |
| 26 | 'systemdsystemunitdir', |
| 27 | define_variable: ['prefix', get_option('prefix')], |
| 28 | ) |
| 29 | configure_file( |
| 30 | copy: true, |
| 31 | input: 'hostlogger@.service', |
| 32 | install: true, |
| 33 | install_dir: systemd_system_unit_dir, |
| 34 | output: 'hostlogger@.service' |
| 35 | ) |
| 36 | |
| 37 | executable( |
| 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', |
| 47 | 'src/service.cpp', |
| 48 | 'src/zlib_exception.cpp', |
| 49 | 'src/zlib_file.cpp', |
| 50 | ], |
| 51 | dependencies: [ |
| 52 | systemd, |
| 53 | dependency('phosphor-logging'), |
| 54 | dependency('zlib'), |
| 55 | ], |
| 56 | install: true |
| 57 | ) |