blob: 93300e913650536d302018d87d40913367f82c2d [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 )
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050038conf_data.set_quoted('CORE_FILE_DIR', get_option('CORE_FILE_DIR'),
39 description : 'Directory where core dumps are placed'
40 )
41conf_data.set_quoted('OBJ_INTERNAL', get_option('OBJ_INTERNAL'),
42 description : 'Internal Dump manager Dbus object path'
43 )
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -050044conf_data.set_quoted('SYSTEM_DUMP_OBJ_ENTRY', get_option('SYSTEM_DUMP_OBJ_ENTRY'),
45 description : 'The system dump entry DBus object path'
46 )
47conf_data.set_quoted('BMC_DUMP_OBJ_ENTRY', get_option('BMC_DUMP_OBJ_ENTRY'),
48 description : 'The BMC dump entry DBus object path'
Ramesh Iyyarbb410df2020-08-03 03:13:04 -050049 )
50conf_data.set_quoted('BMC_DUMP_PATH', get_option('BMC_DUMP_PATH'),
51 description : 'Directory where bmc dumps are placed')
52conf_data.set('BMC_DUMP_MAX_SIZE', get_option('BMC_DUMP_MAX_SIZE'),
53 description : 'Maximum size of one bmc dump in kilo bytes'
54 )
55conf_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 )
58conf_data.set('BMC_DUMP_TOTAL_SIZE', get_option('BMC_DUMP_TOTAL_SIZE'),
59 description : 'Total size of the dump in kilo bytes'
60 )
61conf_data.set_quoted('OBJ_LOGGING', '/xyz/openbmc_project/logging',
62 description : 'The log manager DBus object path'
63 )
64conf_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 )
67conf_data.set('CLASS_VERSION', get_option('CLASS_VERSION'),
68 description : 'Class version to register with Cereal'
69 )
70conf_data.set('ERROR_MAP_YAML', get_option('ERROR_MAP_YAML'),
71 description : 'YAML filepath containing error object paths'
72 )
73conf_data.set('UBI_CORE_FILE_WORKAROUND', get_option('ubifs-workaround').enabled(),
74 description : 'Turn on ubi workaround for core file'
75 )
76
77configure_file(configuration : conf_data,
78 output : 'config.h'
79 )
80
81subdir('xyz/openbmc_project/Dump/Internal/Create')
82
83python = find_program('python3')
84errors_map_gen_file_loc = meson.source_root()
85errors_map_gen_file_loc += '/errors_map_gen.py'
86
87errors_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
102phosphor_dump_manager_sources = [
103 'dump_entry.cpp',
104 'dump_manager.cpp',
Dhruvaraj Subhashchandranfef66a92020-09-06 13:10:59 -0500105 'dump_manager_bmc.cpp',
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500106 '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 Iyyarbb410df2020-08-03 03:13:04 -0500115 'dump_offload.cpp'
116 ]
117
118phosphor_dump_manager_dependency = [
119 phosphor_dbus_interfaces,
120 sdbusplus,
121 phosphor_logging,
122 cppfs
123 ]
124
125phosphor_dump_manager_install = true
126
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600127phosphor_dump_manager_incdir = []
128
Ramesh Iyyar131994b2020-12-03 08:35:36 -0600129# To get host transport based interface to take respective host
130# dump actions. It will contain required sources and dependency
131# list for phosphor_dump_manager.
132subdir('host-transport-extensions')
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500133
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -0500134#pick any architecture specific dumps
135subdir('dump-extensions')
136
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500137phosphor_dump_monitor_sources = [
138 'core_manager.cpp',
139 'core_manager_main.cpp',
140 'watch.cpp'
141 ]
142
143phosphor_dump_monitor_dependency = [
144 phosphor_dbus_interfaces,
145 phosphor_logging,
146 cppfs
147 ]
148
149phosphor_dump_monitor_install = true
150
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600151phosphor_dump_monitor_incdir = []
152
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500153executables = [[ 'phosphor-dump-manager',
154 phosphor_dump_manager_sources,
155 phosphor_dump_manager_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600156 phosphor_dump_manager_install,
157 phosphor_dump_manager_incdir
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500158 ],
159 [ 'phosphor-dump-monitor',
160 phosphor_dump_monitor_sources,
161 phosphor_dump_monitor_dependency,
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600162 phosphor_dump_monitor_install,
163 phosphor_dump_monitor_incdir
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500164 ]
165 ]
166
167foreach executable : executables
168 binary = executable(
169 executable[0],
170 executable[1],
171 dependencies: executable[2],
Ramesh Iyyar3af5c322020-12-04 00:38:42 -0600172 install : executable[3],
173 include_directories : executable[4]
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500174 )
175endforeach
Chirag Sharma50427252020-08-11 12:11:38 -0500176
177if get_option('tests').enabled()
178 subdir('test')
179endif