blob: fcb30042ca443faaaffe518de933014c2314dd34 [file] [log] [blame]
Ramesh Iyyarbb410df2020-08-03 03:13:04 -05001# SPDX-License-Identifier: Apache-2.0
2
3project('phosphor-debug-collector',
4 'cpp',
5 default_options: [
6 'cpp_std=c++17',
7 'warning_level=3',
PriyangaRamasamy01c66462021-02-23 05:46:25 -06008 'werror=true',
9 'buildtype=debugoptimized'
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050010 ],
11 version: '1.0',
12 license: 'Apache-2.0'
13 )
14
15# Checking dependency external library
16
17cppfs = meson.get_compiler('cpp').find_library('stdc++fs')
18libsystemd = dependency('libsystemd', version : '>=221')
19phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
20sdbusplus = dependency('sdbusplus')
21phosphor_logging = dependency('phosphor-logging')
22
PriyangaRamasamy01c66462021-02-23 05:46:25 -060023# Disable FORTIFY_SOURCE when compiling with no optimization
24if(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')
27endif
28
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050029# Configuration header file(config.h) generation
30
31conf_data = configuration_data()
32
33conf_data.set_quoted('DUMP_BUSNAME', get_option('DUMP_BUSNAME'),
34 description : 'The Dbus busname to own'
35 )
36conf_data.set_quoted('DUMP_OBJPATH', get_option('DUMP_OBJPATH'),
37 description : 'The Dump manager Dbus root'
38 )
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050039conf_data.set_quoted('BMC_DUMP_OBJPATH', get_option('BMC_DUMP_OBJPATH'),
40 description : 'The BMC Dump manager Dbus path'
41 )
42conf_data.set_quoted('SYSTEM_DUMP_OBJPATH', get_option('SYSTEM_DUMP_OBJPATH'),
43 description : 'The system Dump manager Dbus path'
44 )
Dhruvaraj Subhashchandran62337a92020-11-22 21:24:30 -060045conf_data.set_quoted('RESOURCE_DUMP_OBJPATH', get_option('RESOURCE_DUMP_OBJPATH'),
46 description : 'The resource Dump manager Dbus path'
47 )
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050048conf_data.set_quoted('CORE_FILE_DIR', get_option('CORE_FILE_DIR'),
49 description : 'Directory where core dumps are placed'
50 )
51conf_data.set_quoted('OBJ_INTERNAL', get_option('OBJ_INTERNAL'),
52 description : 'Internal Dump manager Dbus object path'
53 )
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050054conf_data.set_quoted('SYSTEM_DUMP_OBJ_ENTRY', get_option('SYSTEM_DUMP_OBJ_ENTRY'),
55 description : 'The system dump entry DBus object path'
56 )
Dhruvaraj Subhashchandran62337a92020-11-22 21:24:30 -060057conf_data.set_quoted('RESOURCE_DUMP_OBJ_ENTRY', get_option('RESOURCE_DUMP_OBJ_ENTRY'),
58 description : 'The resource dump entry DBus object path'
59 )
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050060conf_data.set_quoted('BMC_DUMP_OBJ_ENTRY', get_option('BMC_DUMP_OBJ_ENTRY'),
61 description : 'The BMC dump entry DBus object path'
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050062 )
63conf_data.set_quoted('BMC_DUMP_PATH', get_option('BMC_DUMP_PATH'),
64 description : 'Directory where bmc dumps are placed')
George Liuff92ffe2021-02-09 15:01:53 +080065conf_data.set_quoted('SYSTEMD_PSTORE_PATH', get_option('SYSTEMD_PSTORE_PATH'),
66 description : 'Path to the systemd pstore directory')
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050067conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'),
68 description : 'Maximum size of one bmc dump in kilo bytes'
69 )
70conf_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 )
73conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'),
74 description : 'Total size of the dump in kilo bytes'
75 )
76conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging',
77 description : 'The log manager DBus object path'
78 )
79conf_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 )
82conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'),
83 description : 'Class version to register with Cereal'
84 )
85conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'),
86 description : 'YAML filepath containing error object paths'
87 )
Chirag Sharmae22aca72021-01-18 09:55:29 -060088conf_data.set('JFFS_CORE_FILE_WORKAROUND', get_option('jffs-workaround').enabled(),
89 description : 'Turn on jffs workaround for core file'
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050090 )
91
92configure_file(configuration : conf_data,
93 output : 'config.h'
94 )
95
96subdir('xyz/openbmc_project/Dump/Internal/Create')
97
98python = find_program('python3')
99errors_map_gen_file_loc = meson.source_root()
100errors_map_gen_file_loc += '/errors_map_gen.py'
101
102errors_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
117phosphor_dump_manager_sources = [
118 'dump_entry.cpp',
119 'dump_manager.cpp',
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -0500120 'dump_manager_bmc.cpp',
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500121 '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 Iyyarbb410df2020-08-03 03:13:04 -0500130 'dump_offload.cpp'
131 ]
132
133phosphor_dump_manager_dependency = [
134 phosphor_dbus_interfaces,
135 sdbusplus,
136 phosphor_logging,
137 cppfs
138 ]
139
140phosphor_dump_manager_install = true
141
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600142phosphor_dump_manager_incdir = []
143
Ramesh Iyyar131994b2020-12-03 08:35:36 -0600144# 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.
147subdir('host-transport-extensions')
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500148
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -0500149#pick any architecture specific dumps
150subdir('dump-extensions')
151
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500152phosphor_dump_monitor_sources = [
153 'core_manager.cpp',
154 'core_manager_main.cpp',
155 'watch.cpp'
156 ]
157
158phosphor_dump_monitor_dependency = [
159 phosphor_dbus_interfaces,
160 phosphor_logging,
161 cppfs
162 ]
163
164phosphor_dump_monitor_install = true
165
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600166phosphor_dump_monitor_incdir = []
167
George Liuff92ffe2021-02-09 15:01:53 +0800168phosphor_ramoops_monitor_sources = [
169 'ramoops_manager.cpp',
170 'ramoops_manager_main.cpp',
171 'watch.cpp'
172 ]
173
174phosphor_ramoops_monitor_dependency = [
175 phosphor_dbus_interfaces,
176 phosphor_logging,
177 cppfs
178 ]
179
180phosphor_ramoops_monitor_install = true
181
182phosphor_ramoops_monitor_incdir = []
183
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500184executables = [[ 'phosphor-dump-manager',
185 phosphor_dump_manager_sources,
186 phosphor_dump_manager_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600187 phosphor_dump_manager_install,
188 phosphor_dump_manager_incdir
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500189 ],
190 [ 'phosphor-dump-monitor',
191 phosphor_dump_monitor_sources,
192 phosphor_dump_monitor_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600193 phosphor_dump_monitor_install,
194 phosphor_dump_monitor_incdir
George Liuff92ffe2021-02-09 15:01:53 +0800195 ],
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 Iyyarbb410df2020-08-03 03:13:04 -0500201 ]
202 ]
203
204foreach executable : executables
205 binary = executable(
206 executable[0],
207 executable[1],
208 dependencies: executable[2],
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600209 install : executable[3],
210 include_directories : executable[4]
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500211 )
212endforeach
Chirag Sharma50427252020-08-11 12:11:38 -0500213
214if get_option('tests').enabled()
215 subdir('test')
216endif