xref: /openbmc/google-misc/dhcp-done/subprojects/bare-metal-host-monitor/meson.build (revision 815c8873ed8807e2d9912d229056c9e69324e1c0)
1dd9478ddSJohn Wedigproject(
2dd9478ddSJohn Wedig    'host_gpio_monitor',
3dd9478ddSJohn Wedig    'cpp',
4dd9478ddSJohn Wedig    version: '0.1',
5dd9478ddSJohn Wedig    meson_version: '>=1.1.1',
624c61c7eSPatrick Williams    default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
7dd9478ddSJohn Wedig)
8dd9478ddSJohn Wedig
924c61c7eSPatrick Williamsabsls = ['flags', 'flags_internal', 'flags_parse']
10376d781cSJohn Wediglibabsl_deps = []
11376d781cSJohn Wedigforeach absl : absls
12376d781cSJohn Wedig    libabsl_deps += dependency('absl_' + absl)
13376d781cSJohn Wedigendforeach
14376d781cSJohn Wedig
15dd9478ddSJohn Wedigexecutable(
16dd9478ddSJohn Wedig    'host_gpio_monitor',
17dd9478ddSJohn Wedig    'host_gpio_monitor.cpp',
18dd9478ddSJohn Wedig    implicit_include_directories: false,
19*815c8873SJohn Wedig    include_directories : include_directories('.'),
2024c61c7eSPatrick Williams    dependencies: [
21dd9478ddSJohn Wedig        dependency('stdplus'),
22dd9478ddSJohn Wedig        dependency('phosphor-logging'),
23376d781cSJohn Wedig        libabsl_deps,
24dd9478ddSJohn Wedig    ],
25dd9478ddSJohn Wedig    install: true,
26dd9478ddSJohn Wedig    install_dir: get_option('libexecdir'),
27dd9478ddSJohn Wedig)
28dd9478ddSJohn Wedig
29dd9478ddSJohn Wedigsystemd = dependency('systemd')
30dd9478ddSJohn Wedigsystemunitdir = systemd.get_variable('systemdsystemunitdir')
31dd9478ddSJohn Wedig
32dd9478ddSJohn Wediglibexecdir = get_option('prefix') / get_option('libexecdir')
33dd9478ddSJohn Wedig
34dd9478ddSJohn Wedigconfigure_file(
35dd9478ddSJohn Wedig    configuration: {'BIN': libexecdir / 'host_gpio_monitor'},
36376d781cSJohn Wedig    input: 'host-gpio-monitor@.service.in',
37376d781cSJohn Wedig    output: 'host-gpio-monitor@.service',
38dd9478ddSJohn Wedig    install_mode: 'rw-r--r--',
3924c61c7eSPatrick Williams    install_dir: systemunitdir,
4024c61c7eSPatrick Williams)
41*815c8873SJohn Wedig
42*815c8873SJohn Wedig# Set up config file with the dbus information that needs to be monitored.
43*815c8873SJohn Wedigconf_data = configuration_data()
44*815c8873SJohn Wedigconf_data.set_quoted(
45*815c8873SJohn Wedig    'DBUS_SERVICE_NAME',
46*815c8873SJohn Wedig    get_option('host_monitor_service_name')
47*815c8873SJohn Wedig)
48*815c8873SJohn Wedigconf_data.set_quoted('DBUS_OBJECT_PATH', get_option('host_monitor_object_path'))
49*815c8873SJohn Wedigconf_data.set_quoted('DBUS_INTERFACE', get_option('host_monitor_interface'))
50*815c8873SJohn Wedigconf_data.set_quoted('DBUS_PROPERTY_NAME', get_option('host_monitor_property'))
51*815c8873SJohn Wedigconf_data.set_quoted(
52*815c8873SJohn Wedig    'DBUS_PROPERTY_HOST_IN_RESET_VALUE',
53*815c8873SJohn Wedig    get_option('host_monitor_host_in_reset_value')
54*815c8873SJohn Wedig)
55*815c8873SJohn Wedigconf_data.set_quoted(
56*815c8873SJohn Wedig    'DBUS_PROPERTY_HOST_RUNNING_VALUE',
57*815c8873SJohn Wedig    get_option('host_monitor_host_running_value')
58*815c8873SJohn Wedig)
59*815c8873SJohn Wedigconfigure_file(
60*815c8873SJohn Wedig    output: 'host_gpio_monitor_conf.hpp',
61*815c8873SJohn Wedig    configuration: conf_data
62*815c8873SJohn Wedig)
63