Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | |
| 3 | project('phosphor-debug-collector', |
| 4 | 'cpp', |
| 5 | default_options: [ |
| 6 | 'cpp_std=c++17', |
| 7 | 'warning_level=3', |
| 8 | 'werror=true' |
| 9 | ], |
| 10 | version: '1.0', |
| 11 | license: 'Apache-2.0' |
| 12 | ) |
| 13 | |
| 14 | # Checking dependency external library |
| 15 | |
| 16 | cppfs = meson.get_compiler('cpp').find_library('stdc++fs') |
| 17 | libsystemd = dependency('libsystemd', version : '>=221') |
| 18 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 19 | sdbusplus = dependency('sdbusplus') |
| 20 | phosphor_logging = dependency('phosphor-logging') |
| 21 | |
| 22 | # Configuration header file(config.h) generation |
| 23 | |
| 24 | conf_data = configuration_data() |
| 25 | |
| 26 | conf_data.set_quoted('DUMP_BUSNAME', get_option('DUMP_BUSNAME'), |
| 27 | description : 'The Dbus busname to own' |
| 28 | ) |
| 29 | conf_data.set_quoted('DUMP_OBJPATH', get_option('DUMP_OBJPATH'), |
| 30 | description : 'The Dump manager Dbus root' |
| 31 | ) |
| 32 | conf_data.set_quoted('CORE_FILE_DIR', get_option('CORE_FILE_DIR'), |
| 33 | description : 'Directory where core dumps are placed' |
| 34 | ) |
| 35 | conf_data.set_quoted('OBJ_INTERNAL', get_option('OBJ_INTERNAL'), |
| 36 | description : 'Internal Dump manager Dbus object path' |
| 37 | ) |
| 38 | conf_data.set_quoted('OBJ_ENTRY', get_option('OBJ_ENTRY'), |
| 39 | description : 'The dump entry DBus object path' |
| 40 | ) |
| 41 | conf_data.set_quoted('BMC_DUMP_PATH', get_option('BMC_DUMP_PATH'), |
| 42 | description : 'Directory where bmc dumps are placed') |
| 43 | conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'), |
| 44 | description : 'Maximum size of one bmc dump in kilo bytes' |
| 45 | ) |
| 46 | conf_data.set('BMC_DUMP_MIN_SPACE_REQD', get_option('BMC_DUMP_MIN_SPACE_REQD'), |
| 47 | description : 'Minimum space required for one bmc dump in kilo bytes' |
| 48 | ) |
| 49 | conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'), |
| 50 | description : 'Total size of the dump in kilo bytes' |
| 51 | ) |
| 52 | conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging', |
| 53 | description : 'The log manager DBus object path' |
| 54 | ) |
| 55 | conf_data.set_quoted('ELOG_ID_PERSIST_PATH', get_option('ELOG_ID_PERSIST_PATH'), |
| 56 | description : 'Path of file for storing elog id\'s, which have associated dumps' |
| 57 | ) |
| 58 | conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'), |
| 59 | description : 'Class version to register with Cereal' |
| 60 | ) |
| 61 | conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'), |
| 62 | description : 'YAML filepath containing error object paths' |
| 63 | ) |
| 64 | conf_data.set('UBI_CORE_FILE_WORKAROUND', get_option('ubifs-workaround').enabled(), |
| 65 | description : 'Turn on ubi workaround for core file' |
| 66 | ) |
| 67 | |
| 68 | configure_file(configuration : conf_data, |
| 69 | output : 'config.h' |
| 70 | ) |
| 71 | |
| 72 | subdir('xyz/openbmc_project/Dump/Internal/Create') |
| 73 | |
| 74 | python = find_program('python3') |
| 75 | errors_map_gen_file_loc = meson.source_root() |
| 76 | errors_map_gen_file_loc += '/errors_map_gen.py' |
| 77 | |
| 78 | errors_map_hpp = custom_target( |
| 79 | 'errors_map.hpp', |
| 80 | command : [ |
| 81 | python, |
| 82 | errors_map_gen_file_loc, |
| 83 | '-i', |
| 84 | get_option('ERROR_MAP_YAML') |
| 85 | ], |
| 86 | depend_files : [ 'errors_map.mako.hpp', |
| 87 | 'errors_map_gen.py', |
| 88 | get_option('ERROR_MAP_YAML') |
| 89 | ], |
| 90 | output : 'errors_map.hpp' |
| 91 | ) |
| 92 | |
| 93 | phosphor_dump_manager_sources = [ |
| 94 | 'dump_entry.cpp', |
| 95 | 'dump_manager.cpp', |
| 96 | 'dump_manager_main.cpp', |
| 97 | 'dump_serialize.cpp', |
| 98 | 'elog_watch.cpp', |
| 99 | errors_map_hpp, |
| 100 | server_hpp, |
| 101 | server_cpp, |
| 102 | 'watch.cpp', |
| 103 | 'bmc_dump_entry.cpp', |
| 104 | 'dump_utils.cpp', |
| 105 | 'system_dump_entry.cpp', |
| 106 | 'dump_offload.cpp' |
| 107 | ] |
| 108 | |
| 109 | phosphor_dump_manager_dependency = [ |
| 110 | phosphor_dbus_interfaces, |
| 111 | sdbusplus, |
| 112 | phosphor_logging, |
| 113 | cppfs |
| 114 | ] |
| 115 | |
| 116 | phosphor_dump_manager_install = true |
| 117 | |
| 118 | # To get host dump offload transport source files and dependency list |
| 119 | # for phosphor_dump_manager |
| 120 | subdir('offload-extensions') |
| 121 | |
| 122 | phosphor_dump_monitor_sources = [ |
| 123 | 'core_manager.cpp', |
| 124 | 'core_manager_main.cpp', |
| 125 | 'watch.cpp' |
| 126 | ] |
| 127 | |
| 128 | phosphor_dump_monitor_dependency = [ |
| 129 | phosphor_dbus_interfaces, |
| 130 | phosphor_logging, |
| 131 | cppfs |
| 132 | ] |
| 133 | |
| 134 | phosphor_dump_monitor_install = true |
| 135 | |
| 136 | executables = [[ 'phosphor-dump-manager', |
| 137 | phosphor_dump_manager_sources, |
| 138 | phosphor_dump_manager_dependency, |
| 139 | phosphor_dump_manager_install |
| 140 | ], |
| 141 | [ 'phosphor-dump-monitor', |
| 142 | phosphor_dump_monitor_sources, |
| 143 | phosphor_dump_monitor_dependency, |
| 144 | phosphor_dump_monitor_install |
| 145 | ] |
| 146 | ] |
| 147 | |
| 148 | foreach executable : executables |
| 149 | binary = executable( |
| 150 | executable[0], |
| 151 | executable[1], |
| 152 | dependencies: executable[2], |
| 153 | install : executable[3] |
| 154 | ) |
| 155 | endforeach |