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 | ) |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 32 | conf_data.set_quoted('BMC_DUMP_OBJPATH', get_option('BMC_DUMP_OBJPATH'), |
| 33 | description : 'The BMC Dump manager Dbus path' |
| 34 | ) |
| 35 | conf_data.set_quoted('SYSTEM_DUMP_OBJPATH', get_option('SYSTEM_DUMP_OBJPATH'), |
| 36 | description : 'The system Dump manager Dbus path' |
| 37 | ) |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 38 | conf_data.set_quoted('CORE_FILE_DIR', get_option('CORE_FILE_DIR'), |
| 39 | description : 'Directory where core dumps are placed' |
| 40 | ) |
| 41 | conf_data.set_quoted('OBJ_INTERNAL', get_option('OBJ_INTERNAL'), |
| 42 | description : 'Internal Dump manager Dbus object path' |
| 43 | ) |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 44 | conf_data.set_quoted('SYSTEM_DUMP_OBJ_ENTRY', get_option('SYSTEM_DUMP_OBJ_ENTRY'), |
| 45 | description : 'The system dump entry DBus object path' |
| 46 | ) |
| 47 | conf_data.set_quoted('BMC_DUMP_OBJ_ENTRY', get_option('BMC_DUMP_OBJ_ENTRY'), |
| 48 | description : 'The BMC dump entry DBus object path' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 49 | ) |
| 50 | conf_data.set_quoted('BMC_DUMP_PATH', get_option('BMC_DUMP_PATH'), |
| 51 | description : 'Directory where bmc dumps are placed') |
| 52 | conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'), |
| 53 | description : 'Maximum size of one bmc dump in kilo bytes' |
| 54 | ) |
| 55 | conf_data.set('BMC_DUMP_MIN_SPACE_REQD', get_option('BMC_DUMP_MIN_SPACE_REQD'), |
| 56 | description : 'Minimum space required for one bmc dump in kilo bytes' |
| 57 | ) |
| 58 | conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'), |
| 59 | description : 'Total size of the dump in kilo bytes' |
| 60 | ) |
| 61 | conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging', |
| 62 | description : 'The log manager DBus object path' |
| 63 | ) |
| 64 | conf_data.set_quoted('ELOG_ID_PERSIST_PATH', get_option('ELOG_ID_PERSIST_PATH'), |
| 65 | description : 'Path of file for storing elog id\'s, which have associated dumps' |
| 66 | ) |
| 67 | conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'), |
| 68 | description : 'Class version to register with Cereal' |
| 69 | ) |
| 70 | conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'), |
| 71 | description : 'YAML filepath containing error object paths' |
| 72 | ) |
| 73 | conf_data.set('UBI_CORE_FILE_WORKAROUND', get_option('ubifs-workaround').enabled(), |
| 74 | description : 'Turn on ubi workaround for core file' |
| 75 | ) |
| 76 | |
| 77 | configure_file(configuration : conf_data, |
| 78 | output : 'config.h' |
| 79 | ) |
| 80 | |
| 81 | subdir('xyz/openbmc_project/Dump/Internal/Create') |
| 82 | |
| 83 | python = find_program('python3') |
| 84 | errors_map_gen_file_loc = meson.source_root() |
| 85 | errors_map_gen_file_loc += '/errors_map_gen.py' |
| 86 | |
| 87 | errors_map_hpp = custom_target( |
| 88 | 'errors_map.hpp', |
| 89 | command : [ |
| 90 | python, |
| 91 | errors_map_gen_file_loc, |
| 92 | '-i', |
| 93 | get_option('ERROR_MAP_YAML') |
| 94 | ], |
| 95 | depend_files : [ 'errors_map.mako.hpp', |
| 96 | 'errors_map_gen.py', |
| 97 | get_option('ERROR_MAP_YAML') |
| 98 | ], |
| 99 | output : 'errors_map.hpp' |
| 100 | ) |
| 101 | |
| 102 | phosphor_dump_manager_sources = [ |
| 103 | 'dump_entry.cpp', |
| 104 | 'dump_manager.cpp', |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 105 | 'dump_manager_bmc.cpp', |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 106 | 'dump_manager_main.cpp', |
| 107 | 'dump_serialize.cpp', |
| 108 | 'elog_watch.cpp', |
| 109 | errors_map_hpp, |
| 110 | server_hpp, |
| 111 | server_cpp, |
| 112 | 'watch.cpp', |
| 113 | 'bmc_dump_entry.cpp', |
| 114 | 'dump_utils.cpp', |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 115 | 'dump_offload.cpp' |
| 116 | ] |
| 117 | |
| 118 | phosphor_dump_manager_dependency = [ |
| 119 | phosphor_dbus_interfaces, |
| 120 | sdbusplus, |
| 121 | phosphor_logging, |
| 122 | cppfs |
| 123 | ] |
| 124 | |
| 125 | phosphor_dump_manager_install = true |
| 126 | |
| 127 | # To get host dump offload transport source files and dependency list |
| 128 | # for phosphor_dump_manager |
| 129 | subdir('offload-extensions') |
| 130 | |
Dhruvaraj Subhashchandran | 8b9b469 | 2020-09-24 11:59:42 -0500 | [diff] [blame] | 131 | #pick any architecture specific dumps |
| 132 | subdir('dump-extensions') |
| 133 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 134 | phosphor_dump_monitor_sources = [ |
| 135 | 'core_manager.cpp', |
| 136 | 'core_manager_main.cpp', |
| 137 | 'watch.cpp' |
| 138 | ] |
| 139 | |
| 140 | phosphor_dump_monitor_dependency = [ |
| 141 | phosphor_dbus_interfaces, |
| 142 | phosphor_logging, |
| 143 | cppfs |
| 144 | ] |
| 145 | |
| 146 | phosphor_dump_monitor_install = true |
| 147 | |
| 148 | executables = [[ 'phosphor-dump-manager', |
| 149 | phosphor_dump_manager_sources, |
| 150 | phosphor_dump_manager_dependency, |
| 151 | phosphor_dump_manager_install |
| 152 | ], |
| 153 | [ 'phosphor-dump-monitor', |
| 154 | phosphor_dump_monitor_sources, |
| 155 | phosphor_dump_monitor_dependency, |
| 156 | phosphor_dump_monitor_install |
| 157 | ] |
| 158 | ] |
| 159 | |
| 160 | foreach executable : executables |
| 161 | binary = executable( |
| 162 | executable[0], |
| 163 | executable[1], |
| 164 | dependencies: executable[2], |
| 165 | install : executable[3] |
| 166 | ) |
| 167 | endforeach |
Chirag Sharma | 5042725 | 2020-08-11 12:11:38 -0500 | [diff] [blame] | 168 | |
| 169 | if get_option('tests').enabled() |
| 170 | subdir('test') |
| 171 | endif |