blob: b75d9f93e3bde54f41259ff357567af198489afe [file] [log] [blame]
Vijay Khemkae2795302020-07-15 17:28:45 -07001project(
2 'phosphor-health-monitor',
3 'cpp',
4 version: '1.0',
Patrick Williamsba29dbd2025-02-03 14:13:59 -05005 default_options: ['cpp_std=c++23'],
Patrick Williams0b7a9142023-07-12 11:15:49 -05006 meson_version: '>=1.1.1',
Vijay Khemkae2795302020-07-15 17:28:45 -07007)
8
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -08009phosphor_logging_dep = dependency('phosphor-logging')
10phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
11sdbusplus_dep = dependency('sdbusplus')
12sdeventplus_dep = dependency('sdeventplus')
13nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
14base_deps = [
15 phosphor_logging_dep,
16 phosphor_dbus_interfaces_dep,
17 sdbusplus_dep,
18 sdeventplus_dep,
Patrick Williamsba29dbd2025-02-03 14:13:59 -050019 nlohmann_json_dep,
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -080020]
21
Vijay Khemkae2795302020-07-15 17:28:45 -070022executable(
23 'health-monitor',
24 [
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -080025 'health_metric_config.cpp',
Jagpal Singh Gill23f091e2023-12-10 15:23:19 -080026 'health_metric.cpp',
27 'health_utils.cpp',
Jagpal Singh Gill79434b52023-12-10 15:33:05 -080028 'health_metric_collection.cpp',
Jagpal Singh Gill81da1372023-12-15 17:01:03 -080029 'health_monitor.cpp',
Vijay Khemkae2795302020-07-15 17:28:45 -070030 ],
Patrick Williamsba29dbd2025-02-03 14:13:59 -050031 dependencies: [base_deps],
Vijay Khemkae2795302020-07-15 17:28:45 -070032 install: true,
Patrick Williamsba29dbd2025-02-03 14:13:59 -050033 install_dir: get_option('bindir'),
Vijay Khemkae2795302020-07-15 17:28:45 -070034)
35
Vijay Khemkae2795302020-07-15 17:28:45 -070036conf_data = configuration_data()
37conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"')
Patrick Williamsba29dbd2025-02-03 14:13:59 -050038conf_data.set(
39 'MONITOR_COLLECTION_INTERVAL',
40 get_option('monitor-collection-interval'),
41)
Vijay Khemkae2795302020-07-15 17:28:45 -070042
Patrick Williamsba29dbd2025-02-03 14:13:59 -050043configure_file(output: 'config.h', configuration: conf_data)
Vijay Khemkae2795302020-07-15 17:28:45 -070044
45systemd = dependency('systemd')
46conf_data = configuration_data()
47conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
48configure_file(
Patrick Williamsba29dbd2025-02-03 14:13:59 -050049 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 Gill7e11ab02023-12-08 11:41:41 -080055
56if get_option('tests').allowed()
Patrick Williamsba29dbd2025-02-03 14:13:59 -050057 subdir('test')
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -080058endif