John Wedig | dd9478d | 2023-12-08 14:44:53 -0800 | [diff] [blame] | 1 | project( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 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'], |
John Wedig | dd9478d | 2023-12-08 14:44:53 -0800 | [diff] [blame] | 7 | ) |
| 8 | |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 9 | absls = ['flags', 'flags_internal', 'flags_parse'] |
John Wedig | 376d781 | 2024-11-11 16:45:53 -0800 | [diff] [blame] | 10 | libabsl_deps = [] |
| 11 | foreach absl : absls |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 12 | libabsl_deps += dependency('absl_' + absl) |
John Wedig | 376d781 | 2024-11-11 16:45:53 -0800 | [diff] [blame] | 13 | endforeach |
| 14 | |
John Wedig | dd9478d | 2023-12-08 14:44:53 -0800 | [diff] [blame] | 15 | executable( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 16 | 'host_gpio_monitor', |
| 17 | 'host_gpio_monitor.cpp', |
| 18 | implicit_include_directories: false, |
John Wedig | 815c887 | 2025-01-07 13:27:02 -0800 | [diff] [blame] | 19 | include_directories : include_directories('.'), |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 20 | dependencies: [ |
| 21 | dependency('stdplus'), |
| 22 | dependency('phosphor-logging'), |
| 23 | libabsl_deps, |
| 24 | ], |
| 25 | install: true, |
| 26 | install_dir: get_option('libexecdir'), |
John Wedig | dd9478d | 2023-12-08 14:44:53 -0800 | [diff] [blame] | 27 | ) |
| 28 | |
| 29 | systemd = dependency('systemd') |
| 30 | systemunitdir = systemd.get_variable('systemdsystemunitdir') |
| 31 | |
| 32 | libexecdir = get_option('prefix') / get_option('libexecdir') |
| 33 | |
| 34 | configure_file( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 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 | ) |
John Wedig | 815c887 | 2025-01-07 13:27:02 -0800 | [diff] [blame] | 41 | |
| 42 | # Set up config file with the dbus information that needs to be monitored. |
| 43 | conf_data = configuration_data() |
| 44 | conf_data.set_quoted( |
| 45 | 'DBUS_SERVICE_NAME', |
| 46 | get_option('host_monitor_service_name') |
| 47 | ) |
| 48 | conf_data.set_quoted('DBUS_OBJECT_PATH', get_option('host_monitor_object_path')) |
| 49 | conf_data.set_quoted('DBUS_INTERFACE', get_option('host_monitor_interface')) |
| 50 | conf_data.set_quoted('DBUS_PROPERTY_NAME', get_option('host_monitor_property')) |
| 51 | conf_data.set_quoted( |
| 52 | 'DBUS_PROPERTY_HOST_IN_RESET_VALUE', |
| 53 | get_option('host_monitor_host_in_reset_value') |
| 54 | ) |
| 55 | conf_data.set_quoted( |
| 56 | 'DBUS_PROPERTY_HOST_RUNNING_VALUE', |
| 57 | get_option('host_monitor_host_running_value') |
| 58 | ) |
| 59 | configure_file( |
| 60 | output: 'host_gpio_monitor_conf.hpp', |
| 61 | configuration: conf_data |
| 62 | ) |