blob: f3127d60b6702f55160f4c63f218d4f02ceb931a [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 Williams56690152021-09-02 16:06:20 -05006 'cpp_std=c++20',
Vijay Khemkae2795302020-07-15 17:28:45 -07007 ],
Patrick Williams67d40592023-04-12 08:01:22 -05008 meson_version: '>=0.58.0',
Vijay Khemkae2795302020-07-15 17:28:45 -07009)
10
Patrick Williams19527c72021-09-02 16:05:11 -050011cpp = meson.get_compiler('cpp')
12
13if cpp.has_header('nlohmann/json.hpp')
14 nlohmann_json = declare_dependency()
15else
16 subproject('nlohmann-json')
Patrick Williamsa1ed1402022-03-21 10:28:30 -050017 nlohmann_json = dependency('nlohmann_json')
Patrick Williams19527c72021-09-02 16:05:11 -050018endif
19
Vijay Khemkae2795302020-07-15 17:28:45 -070020executable(
21 'health-monitor',
22 [
23 'healthMonitor.cpp',
24 ],
25 dependencies: [
Patrick Williamsa1ed1402022-03-21 10:28:30 -050026 dependency('phosphor-dbus-interfaces'),
27 dependency('phosphor-logging'),
28 dependency('sdbusplus'),
29 dependency('sdeventplus'),
Patrick Williams19527c72021-09-02 16:05:11 -050030 nlohmann_json,
Vijay Khemkae2795302020-07-15 17:28:45 -070031 ],
32 install: true,
33 install_dir: get_option('bindir')
34)
35
36install_data(sources : 'bmc_health_config.json', install_dir : '/etc/healthMon')
37
38conf_data = configuration_data()
39conf_data.set('HEALTH_CONFIG_FILE', '"/etc/healthMon/bmc_health_config.json"')
40conf_data.set('HEALTH_BUS_NAME', '"xyz.openbmc_project.HealthMon"')
41conf_data.set('HEALTH_SENSOR_PATH', '"/xyz/openbmc_project/sensors/utilization/"')
Vijay Khemka1d0d0122020-09-29 12:17:43 -070042conf_data.set('SENSOR_OBJPATH', '"/xyz/openbmc_project/sensors"')
Sui Chen517524a2021-12-19 20:52:46 -080043conf_data.set('INVENTORY_OBJPATH', '"/xyz/openbmc_project/inventory"')
Vijay Khemkae2795302020-07-15 17:28:45 -070044
45configure_file(output : 'config.h',
46 configuration : conf_data)
47
48systemd = dependency('systemd')
49conf_data = configuration_data()
50conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
51configure_file(
52 input: 'phosphor-health-monitor.service.in',
53 output: 'phosphor-health-monitor.service',
54 configuration: conf_data,
55 install: true,
Patrick Williams67d40592023-04-12 08:01:22 -050056 install_dir: systemd.get_variable('systemdsystemunitdir'))