blob: 5f9b27660755f27fffd5b391cf968236c0cf04fc [file] [log] [blame]
Vijay Khemkae2795302020-07-15 17:28:45 -07001project(
2 'phosphor-health-monitor',
3 'cpp',
4 version: '1.0',
5 default_options: [
Patrick Williams0b7a9142023-07-12 11:15:49 -05006 'cpp_std=c++23',
Vijay Khemkae2795302020-07-15 17:28:45 -07007 ],
Patrick Williams0b7a9142023-07-12 11:15:49 -05008 meson_version: '>=1.1.1',
Vijay Khemkae2795302020-07-15 17:28:45 -07009)
10
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -080011phosphor_logging_dep = dependency('phosphor-logging')
12phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
13sdbusplus_dep = dependency('sdbusplus')
14sdeventplus_dep = dependency('sdeventplus')
15nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
16base_deps = [
17 phosphor_logging_dep,
18 phosphor_dbus_interfaces_dep,
19 sdbusplus_dep,
20 sdeventplus_dep,
21 nlohmann_json_dep
22]
23
Vijay Khemkae2795302020-07-15 17:28:45 -070024executable(
25 'health-monitor',
26 [
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -080027 'health_metric_config.cpp',
Jagpal Singh Gill23f091e2023-12-10 15:23:19 -080028 'health_metric.cpp',
29 'health_utils.cpp',
Jagpal Singh Gill79434b52023-12-10 15:33:05 -080030 'health_metric_collection.cpp',
Jagpal Singh Gill81da1372023-12-15 17:01:03 -080031 'health_monitor.cpp',
Vijay Khemkae2795302020-07-15 17:28:45 -070032 ],
33 dependencies: [
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -080034 base_deps
Vijay Khemkae2795302020-07-15 17:28:45 -070035 ],
36 install: true,
37 install_dir: get_option('bindir')
38)
39
Vijay Khemkae2795302020-07-15 17:28:45 -070040conf_data = configuration_data()
41conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"')
42conf_data.set('HEALTH_BUS_NAME', '"xyz.openbmc_project.HealthMon"')
43conf_data.set('HEALTH_SENSOR_PATH', '"/xyz/openbmc_project/sensors/utilization/"')
Vijay Khemka1d0d0122020-09-29 12:17:43 -070044conf_data.set('SENSOR_OBJPATH', '"/xyz/openbmc_project/sensors"')
Sui Chen517524a2021-12-19 20:52:46 -080045conf_data.set('INVENTORY_OBJPATH', '"/xyz/openbmc_project/inventory"')
Vijay Khemkae2795302020-07-15 17:28:45 -070046
47configure_file(output : 'config.h',
48 configuration : conf_data)
49
50systemd = dependency('systemd')
51conf_data = configuration_data()
52conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
53configure_file(
54 input: 'phosphor-health-monitor.service.in',
55 output: 'phosphor-health-monitor.service',
56 configuration: conf_data,
57 install: true,
Patrick Williams67d40592023-04-12 08:01:22 -050058 install_dir: systemd.get_variable('systemdsystemunitdir'))
Jagpal Singh Gill7e11ab02023-12-08 11:41:41 -080059
60if get_option('tests').allowed()
61 subdir('test')
62endif