xref: /openbmc/google-misc/subprojects/bare-metal-host-monitor/meson.build (revision 815c8873ed8807e2d9912d229056c9e69324e1c0)
1project(
2    'host_gpio_monitor',
3    'cpp',
4    version: '0.1',
5    meson_version: '>=1.1.1',
6    default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
7)
8
9absls = ['flags', 'flags_internal', 'flags_parse']
10libabsl_deps = []
11foreach absl : absls
12    libabsl_deps += dependency('absl_' + absl)
13endforeach
14
15executable(
16    'host_gpio_monitor',
17    'host_gpio_monitor.cpp',
18    implicit_include_directories: false,
19    include_directories : include_directories('.'),
20    dependencies: [
21        dependency('stdplus'),
22        dependency('phosphor-logging'),
23        libabsl_deps,
24    ],
25    install: true,
26    install_dir: get_option('libexecdir'),
27)
28
29systemd = dependency('systemd')
30systemunitdir = systemd.get_variable('systemdsystemunitdir')
31
32libexecdir = get_option('prefix') / get_option('libexecdir')
33
34configure_file(
35    configuration: {'BIN': libexecdir / 'host_gpio_monitor'},
36    input: 'host-gpio-monitor@.service.in',
37    output: 'host-gpio-monitor@.service',
38    install_mode: 'rw-r--r--',
39    install_dir: systemunitdir,
40)
41
42# Set up config file with the dbus information that needs to be monitored.
43conf_data = configuration_data()
44conf_data.set_quoted(
45    'DBUS_SERVICE_NAME',
46    get_option('host_monitor_service_name')
47)
48conf_data.set_quoted('DBUS_OBJECT_PATH', get_option('host_monitor_object_path'))
49conf_data.set_quoted('DBUS_INTERFACE', get_option('host_monitor_interface'))
50conf_data.set_quoted('DBUS_PROPERTY_NAME', get_option('host_monitor_property'))
51conf_data.set_quoted(
52    'DBUS_PROPERTY_HOST_IN_RESET_VALUE',
53    get_option('host_monitor_host_in_reset_value')
54)
55conf_data.set_quoted(
56    'DBUS_PROPERTY_HOST_RUNNING_VALUE',
57    get_option('host_monitor_host_running_value')
58)
59configure_file(
60    output: 'host_gpio_monitor_conf.hpp',
61    configuration: conf_data
62)
63