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 | [ |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 27 | 'health_metric_config.cpp', |
Jagpal Singh Gill | 23f091e | 2023-12-10 15:23:19 -0800 | [diff] [blame] | 28 | 'health_metric.cpp', |
| 29 | 'health_utils.cpp', |
Jagpal Singh Gill | 79434b5 | 2023-12-10 15:33:05 -0800 | [diff] [blame] | 30 | 'health_metric_collection.cpp', |
Jagpal Singh Gill | 81da137 | 2023-12-15 17:01:03 -0800 | [diff] [blame] | 31 | 'health_monitor.cpp', |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 32 | ], |
| 33 | dependencies: [ |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 34 | base_deps |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 35 | ], |
| 36 | install: true, |
| 37 | install_dir: get_option('bindir') |
| 38 | ) |
| 39 | |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 40 | conf_data = configuration_data() |
| 41 | conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"') |
Vijay Khemka | e279530 | 2020-07-15 17:28:45 -0700 | [diff] [blame] | 42 | |
| 43 | configure_file(output : 'config.h', |
| 44 | configuration : conf_data) |
| 45 | |
| 46 | systemd = dependency('systemd') |
| 47 | conf_data = configuration_data() |
| 48 | conf_data.set('bindir', get_option('prefix') / get_option('bindir')) |
| 49 | configure_file( |
| 50 | input: 'phosphor-health-monitor.service.in', |
| 51 | output: 'phosphor-health-monitor.service', |
| 52 | configuration: conf_data, |
| 53 | install: true, |
Patrick Williams | 67d4059 | 2023-04-12 08:01:22 -0500 | [diff] [blame] | 54 | install_dir: systemd.get_variable('systemdsystemunitdir')) |
Jagpal Singh Gill | 7e11ab0 | 2023-12-08 11:41:41 -0800 | [diff] [blame] | 55 | |
| 56 | if get_option('tests').allowed() |
| 57 | subdir('test') |
| 58 | endif |