Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-health-monitor', |
| 3 | 'cpp', |
| 4 | version: '1.0', |
| 5 | default_options: [ |
Patrick Williams | 0b7a914 | 2023-07-12 11:15:49 -0500 | [diff] [blame] | 6 | 'cpp_std=c++23', |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 7 | ], |
Patrick Williams | 0b7a914 | 2023-07-12 11:15:49 -0500 | [diff] [blame] | 8 | meson_version: '>=1.1.1', |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 9 | ) |
| 10 | |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 11 | phosphor_logging_dep = dependency('phosphor-logging') |
| 12 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 13 | sdbusplus_dep = dependency('sdbusplus') |
| 14 | sdeventplus_dep = dependency('sdeventplus') |
| 15 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
| 16 | base_deps = [ |
| 17 | phosphor_logging_dep, |
| 18 | phosphor_dbus_interfaces_dep, |
| 19 | sdbusplus_dep, |
| 20 | sdeventplus_dep, |
| 21 | nlohmann_json_dep |
| 22 | ] |
| 23 | |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 24 | executable( |
| 25 | 'health-monitor', |
| 26 | [ |
| 27 | 'healthMonitor.cpp', |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 28 | 'health_metric_config.cpp', |
Jagpal Singh Gill | 23f091e | 2023-12-10 15:23:19 -0800 | [diff] [blame] | 29 | 'health_metric.cpp', |
| 30 | 'health_utils.cpp', |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 31 | ], |
| 32 | dependencies: [ |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 33 | base_deps |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 34 | ], |
| 35 | install: true, |
| 36 | install_dir: get_option('bindir') |
| 37 | ) |
| 38 | |
| 39 | install_data(sources : 'bmc_health_config.json', install_dir : '/etc/healthMon') |
| 40 | |
| 41 | conf_data = configuration_data() |
| 42 | conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"') |
| 43 | conf_data.set('HEALTH_BUS_NAME', '"xyz.openbmc_project.HealthMon"') |
| 44 | conf_data.set('HEALTH_SENSOR_PATH', '"/xyz/openbmc_project/sensors/utilization/"') |
Vijay Khemka | 1d0d012 | 2020-09-29 12:17:43 -0700 | [diff] [blame] | 45 | conf_data.set('SENSOR_OBJPATH', '"/xyz/openbmc_project/sensors"') |
Sui Chen | 517524a | 2021-12-19 20:52:46 -0800 | [diff] [blame] | 46 | conf_data.set('INVENTORY_OBJPATH', '"/xyz/openbmc_project/inventory"') |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 47 | |
| 48 | configure_file(output : 'config.h', |
| 49 | configuration : conf_data) |
| 50 | |
| 51 | systemd = dependency('systemd') |
| 52 | conf_data = configuration_data() |
| 53 | conf_data.set('bindir', get_option('prefix') / get_option('bindir')) |
| 54 | configure_file( |
| 55 | input: 'phosphor-health-monitor.service.in', |
| 56 | output: 'phosphor-health-monitor.service', |
| 57 | configuration: conf_data, |
| 58 | install: true, |
Patrick Williams | 67d4059 | 2023-04-12 08:01:22 -0500 | [diff] [blame] | 59 | install_dir: systemd.get_variable('systemdsystemunitdir')) |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 60 | |
| 61 | if get_option('tests').allowed() |
| 62 | subdir('test') |
| 63 | endif |