blob: e1b06b724d0c198c0b7cfb9f491822dcfec81517 [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')
65conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'),
66 description : 'Maximum size of one bmc dump in kilo bytes'
67 )
68conf_data.set('BMC_DUMP_MIN_SPACE_REQD', get_option('BMC_DUMP_MIN_SPACE_REQD'),
69 description : 'Minimum space required for one bmc dump in kilo bytes'
70 )
71conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'),
72 description : 'Total size of the dump in kilo bytes'
73 )
74conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging',
75 description : 'The log manager DBus object path'
76 )
77conf_data.set_quoted('ELOG_ID_PERSIST_PATH', get_option('ELOG_ID_PERSIST_PATH'),
78 description : 'Path of file for storing elog id\'s, which have associated dumps'
79 )
80conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'),
81 description : 'Class version to register with Cereal'
82 )
83conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'),
84 description : 'YAML filepath containing error object paths'
85 )
Chirag Sharmae22aca72021-01-18 09:55:29 -060086conf_data.set('JFFS_CORE_FILE_WORKAROUND', get_option('jffs-workaround').enabled(),
87 description : 'Turn on jffs workaround for core file'
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050088 )
89
90configure_file(configuration : conf_data,
91 output : 'config.h'
92 )
93
94subdir('xyz/openbmc_project/Dump/Internal/Create')
95
96python = find_program('python3')
97errors_map_gen_file_loc = meson.source_root()
98errors_map_gen_file_loc += '/errors_map_gen.py'
99
100errors_map_hpp = custom_target(
101 'errors_map.hpp',
102 command : [
103 python,
104 errors_map_gen_file_loc,
105 '-i',
106 get_option('ERROR_MAP_YAML')
107 ],
108 depend_files : [ 'errors_map.mako.hpp',
109 'errors_map_gen.py',
110 get_option('ERROR_MAP_YAML')
111 ],
112 output : 'errors_map.hpp'
113 )
114
115phosphor_dump_manager_sources = [
116 'dump_entry.cpp',
117 'dump_manager.cpp',
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -0500118 'dump_manager_bmc.cpp',
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500119 'dump_manager_main.cpp',
120 'dump_serialize.cpp',
121 'elog_watch.cpp',
122 errors_map_hpp,
123 server_hpp,
124 server_cpp,
125 'watch.cpp',
126 'bmc_dump_entry.cpp',
127 'dump_utils.cpp',
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500128 'dump_offload.cpp'
129 ]
130
131phosphor_dump_manager_dependency = [
132 phosphor_dbus_interfaces,
133 sdbusplus,
134 phosphor_logging,
135 cppfs
136 ]
137
138phosphor_dump_manager_install = true
139
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600140phosphor_dump_manager_incdir = []
141
Ramesh Iyyar131994b2020-12-03 08:35:36 -0600142# To get host transport based interface to take respective host
143# dump actions. It will contain required sources and dependency
144# list for phosphor_dump_manager.
145subdir('host-transport-extensions')
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500146
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -0500147#pick any architecture specific dumps
148subdir('dump-extensions')
149
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500150phosphor_dump_monitor_sources = [
151 'core_manager.cpp',
152 'core_manager_main.cpp',
153 'watch.cpp'
154 ]
155
156phosphor_dump_monitor_dependency = [
157 phosphor_dbus_interfaces,
158 phosphor_logging,
159 cppfs
160 ]
161
162phosphor_dump_monitor_install = true
163
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600164phosphor_dump_monitor_incdir = []
165
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500166executables = [[ 'phosphor-dump-manager',
167 phosphor_dump_manager_sources,
168 phosphor_dump_manager_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600169 phosphor_dump_manager_install,
170 phosphor_dump_manager_incdir
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500171 ],
172 [ 'phosphor-dump-monitor',
173 phosphor_dump_monitor_sources,
174 phosphor_dump_monitor_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600175 phosphor_dump_monitor_install,
176 phosphor_dump_monitor_incdir
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500177 ]
178 ]
179
180foreach executable : executables
181 binary = executable(
182 executable[0],
183 executable[1],
184 dependencies: executable[2],
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600185 install : executable[3],
186 include_directories : executable[4]
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500187 )
188endforeach
Chirag Sharma50427252020-08-11 12:11:38 -0500189
190if get_option('tests').enabled()
191 subdir('test')
192endif