blob: fb6282bee6d07ff7957bf9fb2a02e08e6a7842db [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'),
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050035 ]
William A. Kennington III8fd187e2021-07-26 13:36:56 -070036 extra_args += [
Jayanth Othayoth92b20662021-11-05 00:09:15 -050037 '-DPEL_ENABLE_PHAL',
William A. Kennington III8fd187e2021-07-26 13:36:56 -070038 ]
39 log_manager_ext_args += [
Jayanth Othayoth92b20662021-11-05 00:09:15 -050040 '-DPEL_ENABLE_PHAL',
William A. Kennington III8fd187e2021-07-26 13:36:56 -070041 ]
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050042endif
43
Patrick Williamsd9f0d642021-04-21 15:43:21 -050044libpel_sources = files(
45 'ascii_string.cpp',
46 'bcd_time.cpp',
47 'callout.cpp',
48 'callouts.cpp',
49 'data_interface.cpp',
50 'device_callouts.cpp',
51 'extended_user_header.cpp',
52 'failing_mtms.cpp',
53 'fru_identity.cpp',
54 'generic.cpp',
Matt Spinlerd96fa602022-12-15 11:11:26 -060055 'journal.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -050056 'json_utils.cpp',
57 'log_id.cpp',
58 'mru.cpp',
59 'mtms.cpp',
60 'pce_identity.cpp',
61 'pel.cpp',
62 'pel_rules.cpp',
63 'pel_values.cpp',
64 'private_header.cpp',
65 'registry.cpp',
66 'section_factory.cpp',
67 'service_indicators.cpp',
68 'severity.cpp',
69 'user_header.cpp',
Jayanth Othayothbf54cbb2021-06-03 04:36:48 -050070 'temporary_file.cpp',
Arya K Padmand8ae6182024-07-19 06:25:10 -050071 '../../util.cpp',
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050072 extra_sources,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050073)
74
75libpel_deps = [
William A. Kennington IIIe0538842021-06-11 02:01:58 -070076 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050077 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050078 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050079 sdbusplus_dep,
80 sdeventplus_dep,
81 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050082 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050083 extra_dependencies,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050084]
85
86libpel_lib = static_library(
87 'pel',
88 libpel_sources,
89 'paths.cpp', # paths is separate because it is overridden during test.
90 include_directories: include_directories('../..', '../../gen'),
William A. Kennington III8fd187e2021-07-26 13:36:56 -070091 cpp_args: extra_args,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050092 dependencies: [
93 libpel_deps,
94 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -050095)
96
97libpel_dep = declare_dependency(
98 include_directories: include_directories('.'),
99 link_with: libpel_lib,
100 dependencies: [
101 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500102 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500103 sdbusplus_dep,
104 sdeventplus_dep,
105 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -0500106 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -0500107 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500108)
109
110log_manager_ext_deps += [
111 libpel_dep,
112 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500113 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500114]
115
116log_manager_ext_sources += files(
117 'entry_points.cpp',
118 'extended_user_data.cpp',
119 'host_notifier.cpp',
120 'manager.cpp',
Vijay Lobo2fb10212021-08-22 23:24:16 -0500121 'pel_entry.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500122 'pldm_interface.cpp',
123 'repository.cpp',
124 'src.cpp',
125 'user_data.cpp',
126)
127
128install_data(
129 'registry/message_registry.json',
Matt Spinler8e823e12022-05-02 10:24:10 -0500130 'registry/O_component_ids.json',
Matt Spinler2ef9dc92022-05-02 10:58:11 -0500131 'registry/B_component_ids.json',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500132 install_dir: get_option('datadir') / 'phosphor-logging/pels',
133)
134
135peltool_sources = files(
136 'extended_user_data.cpp',
137 'src.cpp',
138 'user_data.cpp',
139 'user_data_json.cpp',
140)
141
142peltool_deps = [
143 CLI11_dep,
William A. Kennington IIIe0538842021-06-11 02:01:58 -0700144 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500145 python_dep,
146]
147
148executable(
149 'peltool',
150 'tools/peltool.cpp',
151 peltool_sources,
152 cpp_args: [ '-DPELTOOL' ],
153 link_args: [ '-lpython' + python_ver ],
154 include_directories: include_directories('../..'),
155 dependencies: [
156 peltool_deps,
157 libpel_dep,
158 ],
159 install: true,
160)