xref: /openbmc/google-misc/ncsid/subprojects/bare-metal-host-monitor/meson.build (revision ecb750eedae4cc951ae9d5d7c95ee4fdc8c3f7ab)
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,
19815c8873SJohn 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)
41815c8873SJohn Wedig
42815c8873SJohn Wedig# Set up config file with the dbus information that needs to be monitored.
43815c8873SJohn Wedigconf_data = configuration_data()
44815c8873SJohn Wedigconf_data.set_quoted(
45815c8873SJohn Wedig    'DBUS_SERVICE_NAME',
46*ecb750eeSPatrick Williams    get_option('host_monitor_service_name'),
47815c8873SJohn Wedig)
48815c8873SJohn Wedigconf_data.set_quoted('DBUS_OBJECT_PATH', get_option('host_monitor_object_path'))
49815c8873SJohn Wedigconf_data.set_quoted('DBUS_INTERFACE', get_option('host_monitor_interface'))
50815c8873SJohn Wedigconf_data.set_quoted('DBUS_PROPERTY_NAME', get_option('host_monitor_property'))
51815c8873SJohn Wedigconf_data.set_quoted(
52815c8873SJohn Wedig    'DBUS_PROPERTY_HOST_IN_RESET_VALUE',
53*ecb750eeSPatrick Williams    get_option('host_monitor_host_in_reset_value'),
54815c8873SJohn Wedig)
55815c8873SJohn Wedigconf_data.set_quoted(
56815c8873SJohn Wedig    'DBUS_PROPERTY_HOST_RUNNING_VALUE',
57*ecb750eeSPatrick Williams    get_option('host_monitor_host_running_value'),
58815c8873SJohn Wedig)
59*ecb750eeSPatrick Williamsconfigure_file(output: 'host_gpio_monitor_conf.hpp', configuration: conf_data)
60