Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-health-monitor', |
| 3 | 'cpp', |
| 4 | version: '1.0', |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 5 | default_options: ['cpp_std=c++23'], |
Patrick Williams | 0b7a914 | 2023-07-12 11:15:49 -0500 | [diff] [blame] | 6 | meson_version: '>=1.1.1', |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 7 | ) |
| 8 | |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 9 | phosphor_logging_dep = dependency('phosphor-logging') |
| 10 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 11 | sdbusplus_dep = dependency('sdbusplus') |
| 12 | sdeventplus_dep = dependency('sdeventplus') |
| 13 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
| 14 | base_deps = [ |
| 15 | phosphor_logging_dep, |
| 16 | phosphor_dbus_interfaces_dep, |
| 17 | sdbusplus_dep, |
| 18 | sdeventplus_dep, |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 19 | nlohmann_json_dep, |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 20 | ] |
| 21 | |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 22 | executable( |
| 23 | 'health-monitor', |
| 24 | [ |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 25 | 'health_metric_config.cpp', |
Jagpal Singh Gill | 23f091e | 2023-12-10 15:23:19 -0800 | [diff] [blame] | 26 | 'health_metric.cpp', |
| 27 | 'health_utils.cpp', |
Jagpal Singh Gill | 79434b5 | 2023-12-10 15:33:05 -0800 | [diff] [blame] | 28 | 'health_metric_collection.cpp', |
Jagpal Singh Gill | 81da137 | 2023-12-15 17:01:03 -0800 | [diff] [blame] | 29 | 'health_monitor.cpp', |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 30 | ], |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 31 | dependencies: [base_deps], |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 32 | install: true, |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 33 | install_dir: get_option('bindir'), |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 34 | ) |
| 35 | |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 36 | conf_data = configuration_data() |
| 37 | conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"') |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 38 | conf_data.set( |
| 39 | 'MONITOR_COLLECTION_INTERVAL', |
| 40 | get_option('monitor-collection-interval'), |
| 41 | ) |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 42 | |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 43 | configure_file(output: 'config.h', configuration: conf_data) |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 44 | |
| 45 | systemd = dependency('systemd') |
| 46 | conf_data = configuration_data() |
| 47 | conf_data.set('bindir', get_option('prefix') / get_option('bindir')) |
| 48 | configure_file( |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 49 | input: 'phosphor-health-monitor.service.in', |
| 50 | output: 'phosphor-health-monitor.service', |
| 51 | configuration: conf_data, |
| 52 | install: true, |
| 53 | install_dir: systemd.get_variable('systemdsystemunitdir'), |
| 54 | ) |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 55 | |
| 56 | if get_option('tests').allowed() |
Patrick Williams | ba29dbd | 2025-02-03 14:13:59 -0500 | [diff] [blame^] | 57 | subdir('test') |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 58 | endif |