blob: a451571d46154445a6106e3ba127ab1a98f55e32 [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',
8 'werror=true'
9 ],
10 version: '1.0',
11 license: 'Apache-2.0'
12 )
13
14# Checking dependency external library
15
16cppfs = meson.get_compiler('cpp').find_library('stdc++fs')
17libsystemd = dependency('libsystemd', version : '>=221')
18phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
19sdbusplus = dependency('sdbusplus')
20phosphor_logging = dependency('phosphor-logging')
21
22# Configuration header file(config.h) generation
23
24conf_data = configuration_data()
25
26conf_data.set_quoted('DUMP_BUSNAME', get_option('DUMP_BUSNAME'),
27 description : 'The Dbus busname to own'
28 )
29conf_data.set_quoted('DUMP_OBJPATH', get_option('DUMP_OBJPATH'),
30 description : 'The Dump manager Dbus root'
31 )
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050032conf_data.set_quoted('BMC_DUMP_OBJPATH', get_option('BMC_DUMP_OBJPATH'),
33 description : 'The BMC Dump manager Dbus path'
34 )
35conf_data.set_quoted('SYSTEM_DUMP_OBJPATH', get_option('SYSTEM_DUMP_OBJPATH'),
36 description : 'The system Dump manager Dbus path'
37 )
Dhruvaraj Subhashchandran62337a92020-11-22 21:24:30 -060038conf_data.set_quoted('RESOURCE_DUMP_OBJPATH', get_option('RESOURCE_DUMP_OBJPATH'),
39 description : 'The resource Dump manager Dbus path'
40 )
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050041conf_data.set_quoted('CORE_FILE_DIR', get_option('CORE_FILE_DIR'),
42 description : 'Directory where core dumps are placed'
43 )
44conf_data.set_quoted('OBJ_INTERNAL', get_option('OBJ_INTERNAL'),
45 description : 'Internal Dump manager Dbus object path'
46 )
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050047conf_data.set_quoted('SYSTEM_DUMP_OBJ_ENTRY', get_option('SYSTEM_DUMP_OBJ_ENTRY'),
48 description : 'The system dump entry DBus object path'
49 )
Dhruvaraj Subhashchandran62337a92020-11-22 21:24:30 -060050conf_data.set_quoted('RESOURCE_DUMP_OBJ_ENTRY', get_option('RESOURCE_DUMP_OBJ_ENTRY'),
51 description : 'The resource dump entry DBus object path'
52 )
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050053conf_data.set_quoted('BMC_DUMP_OBJ_ENTRY', get_option('BMC_DUMP_OBJ_ENTRY'),
54 description : 'The BMC dump entry DBus object path'
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050055 )
56conf_data.set_quoted('BMC_DUMP_PATH', get_option('BMC_DUMP_PATH'),
57 description : 'Directory where bmc dumps are placed')
58conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'),
59 description : 'Maximum size of one bmc dump in kilo bytes'
60 )
61conf_data.set('BMC_DUMP_MIN_SPACE_REQD', get_option('BMC_DUMP_MIN_SPACE_REQD'),
62 description : 'Minimum space required for one bmc dump in kilo bytes'
63 )
64conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'),
65 description : 'Total size of the dump in kilo bytes'
66 )
67conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging',
68 description : 'The log manager DBus object path'
69 )
70conf_data.set_quoted('ELOG_ID_PERSIST_PATH', get_option('ELOG_ID_PERSIST_PATH'),
71 description : 'Path of file for storing elog id\'s, which have associated dumps'
72 )
73conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'),
74 description : 'Class version to register with Cereal'
75 )
76conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'),
77 description : 'YAML filepath containing error object paths'
78 )
Chirag Sharmae22aca72021-01-18 09:55:29 -060079conf_data.set('JFFS_CORE_FILE_WORKAROUND', get_option('jffs-workaround').enabled(),
80 description : 'Turn on jffs workaround for core file'
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050081 )
82
83configure_file(configuration : conf_data,
84 output : 'config.h'
85 )
86
87subdir('xyz/openbmc_project/Dump/Internal/Create')
88
89python = find_program('python3')
90errors_map_gen_file_loc = meson.source_root()
91errors_map_gen_file_loc += '/errors_map_gen.py'
92
93errors_map_hpp = custom_target(
94 'errors_map.hpp',
95 command : [
96 python,
97 errors_map_gen_file_loc,
98 '-i',
99 get_option('ERROR_MAP_YAML')
100 ],
101 depend_files : [ 'errors_map.mako.hpp',
102 'errors_map_gen.py',
103 get_option('ERROR_MAP_YAML')
104 ],
105 output : 'errors_map.hpp'
106 )
107
108phosphor_dump_manager_sources = [
109 'dump_entry.cpp',
110 'dump_manager.cpp',
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -0500111 'dump_manager_bmc.cpp',
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500112 'dump_manager_main.cpp',
113 'dump_serialize.cpp',
114 'elog_watch.cpp',
115 errors_map_hpp,
116 server_hpp,
117 server_cpp,
118 'watch.cpp',
119 'bmc_dump_entry.cpp',
120 'dump_utils.cpp',
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500121 'dump_offload.cpp'
122 ]
123
124phosphor_dump_manager_dependency = [
125 phosphor_dbus_interfaces,
126 sdbusplus,
127 phosphor_logging,
128 cppfs
129 ]
130
131phosphor_dump_manager_install = true
132
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600133phosphor_dump_manager_incdir = []
134
Ramesh Iyyar131994b2020-12-03 08:35:36 -0600135# To get host transport based interface to take respective host
136# dump actions. It will contain required sources and dependency
137# list for phosphor_dump_manager.
138subdir('host-transport-extensions')
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500139
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -0500140#pick any architecture specific dumps
141subdir('dump-extensions')
142
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500143phosphor_dump_monitor_sources = [
144 'core_manager.cpp',
145 'core_manager_main.cpp',
146 'watch.cpp'
147 ]
148
149phosphor_dump_monitor_dependency = [
150 phosphor_dbus_interfaces,
151 phosphor_logging,
152 cppfs
153 ]
154
155phosphor_dump_monitor_install = true
156
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600157phosphor_dump_monitor_incdir = []
158
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500159executables = [[ 'phosphor-dump-manager',
160 phosphor_dump_manager_sources,
161 phosphor_dump_manager_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600162 phosphor_dump_manager_install,
163 phosphor_dump_manager_incdir
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500164 ],
165 [ 'phosphor-dump-monitor',
166 phosphor_dump_monitor_sources,
167 phosphor_dump_monitor_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600168 phosphor_dump_monitor_install,
169 phosphor_dump_monitor_incdir
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500170 ]
171 ]
172
173foreach executable : executables
174 binary = executable(
175 executable[0],
176 executable[1],
177 dependencies: executable[2],
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600178 install : executable[3],
179 include_directories : executable[4]
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500180 )
181endforeach
Chirag Sharma50427252020-08-11 12:11:38 -0500182
183if get_option('tests').enabled()
184 subdir('test')
185endif