blob: cff4e682fc699e532999b144f39cb459e89a05b9 [file] [log] [blame]
Patrick Williamsd9f0d642021-04-21 15:43:21 -05001libpldm_dep = dependency(
2 'libpldm',
Matt Spinler1a6b3112023-05-05 10:17:08 -05003 default_options: ['oem-ibm=enabled'],
Patrick Williamsd9f0d642021-04-21 15:43:21 -05004)
5
Patrick Williams11565fe2023-12-07 12:19:01 -06006nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
Patrick Williamsd9f0d642021-04-21 15:43:21 -05007
8python_inst = import('python').find_installation('python3')
9python_ver = python_inst.language_version()
10python_dep = python_inst.dependency()
11
12if cpp.has_header('CLI/CLI.hpp')
13 CLI11_dep = declare_dependency()
14else
Patrick Williams62bc9682022-03-21 09:23:11 -050015 CLI11_dep = dependency('CLI11')
Patrick Williamsd9f0d642021-04-21 15:43:21 -050016endif
17
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050018extra_sources = []
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050019extra_dependencies = []
William A. Kennington III8fd187e2021-07-26 13:36:56 -070020extra_args = []
Jayanth Othayothbf54cbb2021-06-03 04:36:48 -050021
Patrick Williamsc8ff39d2023-11-29 06:43:49 -060022build_phal = get_option('phal').allowed()
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050023
24if build_phal
25 extra_sources += [
26 'sbe_ffdc_handler.cpp',
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050027 'fapi_data_process.cpp',
Jayanth Othayothda9b5832021-11-05 04:19:43 -050028 'phal_service_actions.cpp',
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050029 ]
30 extra_dependencies += [
31 dependency('libdt-api'),
32 cpp.find_library('pdbg'),
Jayanth Othayothc74c2202021-06-04 06:42:43 -050033 cpp.find_library('ekb'),
Jayanth Othayoth3ef7b602021-11-09 06:40:38 -060034 cpp.find_library('phal'),
Deepa Karthikeyanff35be32024-10-15 09:10:49 -050035 cpp.find_library('libguard'),
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050036 ]
William A. Kennington III8fd187e2021-07-26 13:36:56 -070037 extra_args += [
Jayanth Othayoth92b20662021-11-05 00:09:15 -050038 '-DPEL_ENABLE_PHAL',
William A. Kennington III8fd187e2021-07-26 13:36:56 -070039 ]
40 log_manager_ext_args += [
Jayanth Othayoth92b20662021-11-05 00:09:15 -050041 '-DPEL_ENABLE_PHAL',
William A. Kennington III8fd187e2021-07-26 13:36:56 -070042 ]
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050043endif
44
Patrick Williamsd9f0d642021-04-21 15:43:21 -050045libpel_sources = files(
46 'ascii_string.cpp',
47 'bcd_time.cpp',
48 'callout.cpp',
49 'callouts.cpp',
50 'data_interface.cpp',
51 'device_callouts.cpp',
52 'extended_user_header.cpp',
53 'failing_mtms.cpp',
54 'fru_identity.cpp',
55 'generic.cpp',
Matt Spinlerd96fa602022-12-15 11:11:26 -060056 'journal.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -050057 'json_utils.cpp',
58 'log_id.cpp',
59 'mru.cpp',
60 'mtms.cpp',
61 'pce_identity.cpp',
62 'pel.cpp',
63 'pel_rules.cpp',
64 'pel_values.cpp',
65 'private_header.cpp',
66 'registry.cpp',
67 'section_factory.cpp',
68 'service_indicators.cpp',
69 'severity.cpp',
70 'user_header.cpp',
Jayanth Othayothbf54cbb2021-06-03 04:36:48 -050071 'temporary_file.cpp',
Patrick Williamsfa2d9622024-09-30 16:25:43 -040072 '../../paths.cpp',
Arya K Padmand8ae6182024-07-19 06:25:10 -050073 '../../util.cpp',
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050074 extra_sources,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050075)
76
77libpel_deps = [
William A. Kennington IIIe0538842021-06-11 02:01:58 -070078 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050079 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050080 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050081 sdbusplus_dep,
82 sdeventplus_dep,
83 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050084 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050085 extra_dependencies,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050086]
87
88libpel_lib = static_library(
89 'pel',
90 libpel_sources,
Patrick Williamsfa2d9622024-09-30 16:25:43 -040091 'pel_paths.cpp', # paths is separate because it is overridden during test.
Patrick Williamsd9f0d642021-04-21 15:43:21 -050092 include_directories: include_directories('../..', '../../gen'),
William A. Kennington III8fd187e2021-07-26 13:36:56 -070093 cpp_args: extra_args,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050094 dependencies: [
95 libpel_deps,
96 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -050097)
98
99libpel_dep = declare_dependency(
100 include_directories: include_directories('.'),
101 link_with: libpel_lib,
102 dependencies: [
103 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500104 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500105 sdbusplus_dep,
106 sdeventplus_dep,
107 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -0500108 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -0500109 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500110)
111
112log_manager_ext_deps += [
113 libpel_dep,
114 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500115 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500116]
117
118log_manager_ext_sources += files(
119 'entry_points.cpp',
120 'extended_user_data.cpp',
121 'host_notifier.cpp',
122 'manager.cpp',
Vijay Lobo2fb10212021-08-22 23:24:16 -0500123 'pel_entry.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500124 'pldm_interface.cpp',
125 'repository.cpp',
126 'src.cpp',
127 'user_data.cpp',
128)
129
130install_data(
131 'registry/message_registry.json',
Matt Spinler8e823e12022-05-02 10:24:10 -0500132 'registry/O_component_ids.json',
Matt Spinler2ef9dc92022-05-02 10:58:11 -0500133 'registry/B_component_ids.json',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500134 install_dir: get_option('datadir') / 'phosphor-logging/pels',
135)
136
137peltool_sources = files(
138 'extended_user_data.cpp',
139 'src.cpp',
140 'user_data.cpp',
141 'user_data_json.cpp',
142)
143
144peltool_deps = [
145 CLI11_dep,
William A. Kennington IIIe0538842021-06-11 02:01:58 -0700146 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500147 python_dep,
148]
149
150executable(
151 'peltool',
152 'tools/peltool.cpp',
153 peltool_sources,
154 cpp_args: [ '-DPELTOOL' ],
155 link_args: [ '-lpython' + python_ver ],
156 include_directories: include_directories('../..'),
157 dependencies: [
158 peltool_deps,
159 libpel_dep,
160 ],
161 install: true,
162)