blob: 8492d5d750a8e24d900f48bd47a7ed25e87260f1 [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',
106 'dump_manager_system.cpp',
Ramesh Iyyarbb410df2020-08-03 03:13:04 -0500107 'dump_manager_main.cpp',
108 'dump_serialize.cpp',
109 'elog_watch.cpp',
110 errors_map_hpp,
111 server_hpp,
112 server_cpp,
113 'watch.cpp',
114 'bmc_dump_entry.cpp',
115 'dump_utils.cpp',
116 'system_dump_entry.cpp',
117 'dump_offload.cpp'
118 ]
119
120phosphor_dump_manager_dependency = [
121 phosphor_dbus_interfaces,
122 sdbusplus,
123 phosphor_logging,
124 cppfs
125 ]
126
127phosphor_dump_manager_install = true
128
129# To get host dump offload transport source files and dependency list
130# for phosphor_dump_manager
131subdir('offload-extensions')
132
133phosphor_dump_monitor_sources = [
134 'core_manager.cpp',
135 'core_manager_main.cpp',
136 'watch.cpp'
137 ]
138
139phosphor_dump_monitor_dependency = [
140 phosphor_dbus_interfaces,
141 phosphor_logging,
142 cppfs
143 ]
144
145phosphor_dump_monitor_install = true
146
147executables = [[ 'phosphor-dump-manager',
148 phosphor_dump_manager_sources,
149 phosphor_dump_manager_dependency,
150 phosphor_dump_manager_install
151 ],
152 [ 'phosphor-dump-monitor',
153 phosphor_dump_monitor_sources,
154 phosphor_dump_monitor_dependency,
155 phosphor_dump_monitor_install
156 ]
157 ]
158
159foreach executable : executables
160 binary = executable(
161 executable[0],
162 executable[1],
163 dependencies: executable[2],
164 install : executable[3]
165 )
166endforeach
Chirag Sharma50427252020-08-11 12:11:38 -0500167
168if get_option('tests').enabled()
169 subdir('test')
170endif