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', |
PriyangaRamasamy | 01c6646 | 2021-02-23 05:46:25 -0600 | [diff] [blame] | 8 | 'werror=true', |
| 9 | 'buildtype=debugoptimized' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 10 | ], |
| 11 | version: '1.0', |
| 12 | license: 'Apache-2.0' |
| 13 | ) |
| 14 | |
| 15 | # Checking dependency external library |
| 16 | |
| 17 | cppfs = meson.get_compiler('cpp').find_library('stdc++fs') |
| 18 | libsystemd = dependency('libsystemd', version : '>=221') |
| 19 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 20 | sdbusplus = dependency('sdbusplus') |
| 21 | phosphor_logging = dependency('phosphor-logging') |
| 22 | |
PriyangaRamasamy | 01c6646 | 2021-02-23 05:46:25 -0600 | [diff] [blame] | 23 | # Disable FORTIFY_SOURCE when compiling with no optimization |
| 24 | if(get_option('optimization') == '0') |
| 25 | add_project_arguments('-U_FORTIFY_SOURCE',language:['cpp','c']) |
| 26 | message('Disabling FORTIFY_SOURCE as optimization is set to 0') |
| 27 | endif |
| 28 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 29 | # Configuration header file(config.h) generation |
| 30 | |
| 31 | conf_data = configuration_data() |
| 32 | |
| 33 | conf_data.set_quoted('DUMP_BUSNAME', get_option('DUMP_BUSNAME'), |
| 34 | description : 'The Dbus busname to own' |
| 35 | ) |
| 36 | conf_data.set_quoted('DUMP_OBJPATH', get_option('DUMP_OBJPATH'), |
| 37 | description : 'The Dump manager Dbus root' |
| 38 | ) |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 39 | conf_data.set_quoted('BMC_DUMP_OBJPATH', get_option('BMC_DUMP_OBJPATH'), |
| 40 | description : 'The BMC Dump manager Dbus path' |
| 41 | ) |
| 42 | conf_data.set_quoted('SYSTEM_DUMP_OBJPATH', get_option('SYSTEM_DUMP_OBJPATH'), |
| 43 | description : 'The system Dump manager Dbus path' |
| 44 | ) |
Dhruvaraj Subhashchandran | 62337a9 | 2020-11-22 21:24:30 -0600 | [diff] [blame] | 45 | conf_data.set_quoted('RESOURCE_DUMP_OBJPATH', get_option('RESOURCE_DUMP_OBJPATH'), |
| 46 | description : 'The resource Dump manager Dbus path' |
| 47 | ) |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 48 | conf_data.set_quoted('CORE_FILE_DIR', get_option('CORE_FILE_DIR'), |
| 49 | description : 'Directory where core dumps are placed' |
| 50 | ) |
| 51 | conf_data.set_quoted('OBJ_INTERNAL', get_option('OBJ_INTERNAL'), |
| 52 | description : 'Internal Dump manager Dbus object path' |
| 53 | ) |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 54 | conf_data.set_quoted('SYSTEM_DUMP_OBJ_ENTRY', get_option('SYSTEM_DUMP_OBJ_ENTRY'), |
| 55 | description : 'The system dump entry DBus object path' |
| 56 | ) |
Dhruvaraj Subhashchandran | 62337a9 | 2020-11-22 21:24:30 -0600 | [diff] [blame] | 57 | conf_data.set_quoted('RESOURCE_DUMP_OBJ_ENTRY', get_option('RESOURCE_DUMP_OBJ_ENTRY'), |
| 58 | description : 'The resource dump entry DBus object path' |
| 59 | ) |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 60 | conf_data.set_quoted('BMC_DUMP_OBJ_ENTRY', get_option('BMC_DUMP_OBJ_ENTRY'), |
| 61 | description : 'The BMC dump entry DBus object path' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 62 | ) |
| 63 | conf_data.set_quoted('BMC_DUMP_PATH', get_option('BMC_DUMP_PATH'), |
| 64 | description : 'Directory where bmc dumps are placed') |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame^] | 65 | conf_data.set_quoted('SYSTEMD_PSTORE_PATH', get_option('SYSTEMD_PSTORE_PATH'), |
| 66 | description : 'Path to the systemd pstore directory') |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 67 | conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'), |
| 68 | description : 'Maximum size of one bmc dump in kilo bytes' |
| 69 | ) |
| 70 | conf_data.set('BMC_DUMP_MIN_SPACE_REQD', get_option('BMC_DUMP_MIN_SPACE_REQD'), |
| 71 | description : 'Minimum space required for one bmc dump in kilo bytes' |
| 72 | ) |
| 73 | conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'), |
| 74 | description : 'Total size of the dump in kilo bytes' |
| 75 | ) |
| 76 | conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging', |
| 77 | description : 'The log manager DBus object path' |
| 78 | ) |
| 79 | conf_data.set_quoted('ELOG_ID_PERSIST_PATH', get_option('ELOG_ID_PERSIST_PATH'), |
| 80 | description : 'Path of file for storing elog id\'s, which have associated dumps' |
| 81 | ) |
| 82 | conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'), |
| 83 | description : 'Class version to register with Cereal' |
| 84 | ) |
| 85 | conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'), |
| 86 | description : 'YAML filepath containing error object paths' |
| 87 | ) |
Chirag Sharma | e22aca7 | 2021-01-18 09:55:29 -0600 | [diff] [blame] | 88 | conf_data.set('JFFS_CORE_FILE_WORKAROUND', get_option('jffs-workaround').enabled(), |
| 89 | description : 'Turn on jffs workaround for core file' |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 90 | ) |
| 91 | |
| 92 | configure_file(configuration : conf_data, |
| 93 | output : 'config.h' |
| 94 | ) |
| 95 | |
| 96 | subdir('xyz/openbmc_project/Dump/Internal/Create') |
| 97 | |
| 98 | python = find_program('python3') |
| 99 | errors_map_gen_file_loc = meson.source_root() |
| 100 | errors_map_gen_file_loc += '/errors_map_gen.py' |
| 101 | |
| 102 | errors_map_hpp = custom_target( |
| 103 | 'errors_map.hpp', |
| 104 | command : [ |
| 105 | python, |
| 106 | errors_map_gen_file_loc, |
| 107 | '-i', |
| 108 | get_option('ERROR_MAP_YAML') |
| 109 | ], |
| 110 | depend_files : [ 'errors_map.mako.hpp', |
| 111 | 'errors_map_gen.py', |
| 112 | get_option('ERROR_MAP_YAML') |
| 113 | ], |
| 114 | output : 'errors_map.hpp' |
| 115 | ) |
| 116 | |
| 117 | phosphor_dump_manager_sources = [ |
| 118 | 'dump_entry.cpp', |
| 119 | 'dump_manager.cpp', |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 120 | 'dump_manager_bmc.cpp', |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 121 | 'dump_manager_main.cpp', |
| 122 | 'dump_serialize.cpp', |
| 123 | 'elog_watch.cpp', |
| 124 | errors_map_hpp, |
| 125 | server_hpp, |
| 126 | server_cpp, |
| 127 | 'watch.cpp', |
| 128 | 'bmc_dump_entry.cpp', |
| 129 | 'dump_utils.cpp', |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 130 | 'dump_offload.cpp' |
| 131 | ] |
| 132 | |
| 133 | phosphor_dump_manager_dependency = [ |
| 134 | phosphor_dbus_interfaces, |
| 135 | sdbusplus, |
| 136 | phosphor_logging, |
| 137 | cppfs |
| 138 | ] |
| 139 | |
| 140 | phosphor_dump_manager_install = true |
| 141 | |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 142 | phosphor_dump_manager_incdir = [] |
| 143 | |
Ramesh Iyyar | 131994b | 2020-12-03 08:35:36 -0600 | [diff] [blame] | 144 | # To get host transport based interface to take respective host |
| 145 | # dump actions. It will contain required sources and dependency |
| 146 | # list for phosphor_dump_manager. |
| 147 | subdir('host-transport-extensions') |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 148 | |
Dhruvaraj Subhashchandran | 8b9b469 | 2020-09-24 11:59:42 -0500 | [diff] [blame] | 149 | #pick any architecture specific dumps |
| 150 | subdir('dump-extensions') |
| 151 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 152 | phosphor_dump_monitor_sources = [ |
| 153 | 'core_manager.cpp', |
| 154 | 'core_manager_main.cpp', |
| 155 | 'watch.cpp' |
| 156 | ] |
| 157 | |
| 158 | phosphor_dump_monitor_dependency = [ |
| 159 | phosphor_dbus_interfaces, |
| 160 | phosphor_logging, |
| 161 | cppfs |
| 162 | ] |
| 163 | |
| 164 | phosphor_dump_monitor_install = true |
| 165 | |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 166 | phosphor_dump_monitor_incdir = [] |
| 167 | |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame^] | 168 | phosphor_ramoops_monitor_sources = [ |
| 169 | 'ramoops_manager.cpp', |
| 170 | 'ramoops_manager_main.cpp', |
| 171 | 'watch.cpp' |
| 172 | ] |
| 173 | |
| 174 | phosphor_ramoops_monitor_dependency = [ |
| 175 | phosphor_dbus_interfaces, |
| 176 | phosphor_logging, |
| 177 | cppfs |
| 178 | ] |
| 179 | |
| 180 | phosphor_ramoops_monitor_install = true |
| 181 | |
| 182 | phosphor_ramoops_monitor_incdir = [] |
| 183 | |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 184 | executables = [[ 'phosphor-dump-manager', |
| 185 | phosphor_dump_manager_sources, |
| 186 | phosphor_dump_manager_dependency, |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 187 | phosphor_dump_manager_install, |
| 188 | phosphor_dump_manager_incdir |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 189 | ], |
| 190 | [ 'phosphor-dump-monitor', |
| 191 | phosphor_dump_monitor_sources, |
| 192 | phosphor_dump_monitor_dependency, |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 193 | phosphor_dump_monitor_install, |
| 194 | phosphor_dump_monitor_incdir |
George Liu | ff92ffe | 2021-02-09 15:01:53 +0800 | [diff] [blame^] | 195 | ], |
| 196 | [ 'phosphor-ramoops-monitor', |
| 197 | phosphor_ramoops_monitor_sources, |
| 198 | phosphor_ramoops_monitor_dependency, |
| 199 | phosphor_ramoops_monitor_install, |
| 200 | phosphor_ramoops_monitor_incdir |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 201 | ] |
| 202 | ] |
| 203 | |
| 204 | foreach executable : executables |
| 205 | binary = executable( |
| 206 | executable[0], |
| 207 | executable[1], |
| 208 | dependencies: executable[2], |
Ramesh Iyyar | 3af5c32 | 2020-12-04 00:38:42 -0600 | [diff] [blame] | 209 | install : executable[3], |
| 210 | include_directories : executable[4] |
Ramesh Iyyar | bb410df | 2020-08-03 03:13:04 -0500 | [diff] [blame] | 211 | ) |
| 212 | endforeach |
Chirag Sharma | 5042725 | 2020-08-11 12:11:38 -0500 | [diff] [blame] | 213 | |
| 214 | if get_option('tests').enabled() |
| 215 | subdir('test') |
| 216 | endif |