1project(
2    'phosphor-health-monitor',
3    'cpp',
4    version: '1.0',
5    default_options: [
6        'cpp_std=c++23',
7    ],
8    meson_version: '>=1.1.1',
9)
10
11executable(
12    'health-monitor',
13    [
14        'healthMonitor.cpp',
15    ],
16    dependencies: [
17        dependency('phosphor-dbus-interfaces'),
18        dependency('phosphor-logging'),
19        dependency('sdbusplus'),
20        dependency('sdeventplus'),
21        dependency('nlohmann_json', include_type: 'system')
22    ],
23    install: true,
24    install_dir: get_option('bindir')
25)
26
27install_data(sources : 'bmc_health_config.json', install_dir : '/etc/healthMon')
28
29conf_data = configuration_data()
30conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"')
31conf_data.set('HEALTH_BUS_NAME', '"xyz.openbmc_project.HealthMon"')
32conf_data.set('HEALTH_SENSOR_PATH', '"/xyz/openbmc_project/sensors/utilization/"')
33conf_data.set('SENSOR_OBJPATH', '"/xyz/openbmc_project/sensors"')
34conf_data.set('INVENTORY_OBJPATH', '"/xyz/openbmc_project/inventory"')
35
36configure_file(output : 'config.h',
37               configuration : conf_data)
38
39systemd = dependency('systemd')
40conf_data = configuration_data()
41conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
42configure_file(
43  input: 'phosphor-health-monitor.service.in',
44  output: 'phosphor-health-monitor.service',
45  configuration: conf_data,
46  install: true,
47  install_dir: systemd.get_variable('systemdsystemunitdir'))
48