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 | |
Patrick Williams | 19527c7 | 2021-09-02 16:05:11 -0500 | [diff] [blame] | 11 | cpp = meson.get_compiler('cpp') |
| 12 | |
| 13 | if cpp.has_header('nlohmann/json.hpp') |
| 14 | nlohmann_json = declare_dependency() |
| 15 | else |
| 16 | subproject('nlohmann-json') |
Patrick Williams | a1ed140 | 2022-03-21 10:28:30 -0500 | [diff] [blame] | 17 | nlohmann_json = dependency('nlohmann_json') |
Patrick Williams | 19527c7 | 2021-09-02 16:05:11 -0500 | [diff] [blame] | 18 | endif |
| 19 | |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 20 | executable( |
| 21 | 'health-monitor', |
| 22 | [ |
| 23 | 'healthMonitor.cpp', |
| 24 | ], |
| 25 | dependencies: [ |
Patrick Williams | a1ed140 | 2022-03-21 10:28:30 -0500 | [diff] [blame] | 26 | dependency('phosphor-dbus-interfaces'), |
| 27 | dependency('phosphor-logging'), |
| 28 | dependency('sdbusplus'), |
| 29 | dependency('sdeventplus'), |
Patrick Williams | 19527c7 | 2021-09-02 16:05:11 -0500 | [diff] [blame] | 30 | nlohmann_json, |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 31 | ], |
| 32 | install: true, |
| 33 | install_dir: get_option('bindir') |
| 34 | ) |
| 35 | |
| 36 | install_data(sources : 'bmc_health_config.json', install_dir : '/etc/healthMon') |
| 37 | |
| 38 | conf_data = configuration_data() |
| 39 | conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"') |
| 40 | conf_data.set('HEALTH_BUS_NAME', '"xyz.openbmc_project.HealthMon"') |
| 41 | conf_data.set('HEALTH_SENSOR_PATH', '"/xyz/openbmc_project/sensors/utilization/"') |
Vijay Khemka | 1d0d012 | 2020-09-29 12:17:43 -0700 | [diff] [blame] | 42 | conf_data.set('SENSOR_OBJPATH', '"/xyz/openbmc_project/sensors"') |
Sui Chen | 517524a | 2021-12-19 20:52:46 -0800 | [diff] [blame] | 43 | conf_data.set('INVENTORY_OBJPATH', '"/xyz/openbmc_project/inventory"') |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 44 | |
| 45 | configure_file(output : 'config.h', |
| 46 | configuration : conf_data) |
| 47 | |
| 48 | systemd = dependency('systemd') |
| 49 | conf_data = configuration_data() |
| 50 | conf_data.set('bindir', get_option('prefix') / get_option('bindir')) |
| 51 | configure_file( |
| 52 | input: 'phosphor-health-monitor.service.in', |
| 53 | output: 'phosphor-health-monitor.service', |
| 54 | configuration: conf_data, |
| 55 | install: true, |
Patrick Williams | 67d4059 | 2023-04-12 08:01:22 -0500 | [diff] [blame] | 56 | install_dir: systemd.get_variable('systemdsystemunitdir')) |