blob: 478a83c3bf9adf69c1ad33cee4b89186751c506e [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',
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050071 extra_sources,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050072)
73
74libpel_deps = [
William A. Kennington IIIe0538842021-06-11 02:01:58 -070075 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050076 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050077 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050078 sdbusplus_dep,
79 sdeventplus_dep,
80 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050081 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050082 extra_dependencies,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050083]
84
85libpel_lib = static_library(
86 'pel',
87 libpel_sources,
88 'paths.cpp', # paths is separate because it is overridden during test.
89 include_directories: include_directories('../..', '../../gen'),
William A. Kennington III8fd187e2021-07-26 13:36:56 -070090 cpp_args: extra_args,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050091 dependencies: [
92 libpel_deps,
93 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -050094)
95
96libpel_dep = declare_dependency(
97 include_directories: include_directories('.'),
98 link_with: libpel_lib,
99 dependencies: [
100 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500101 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500102 sdbusplus_dep,
103 sdeventplus_dep,
104 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -0500105 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -0500106 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500107)
108
109log_manager_ext_deps += [
110 libpel_dep,
111 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500112 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500113]
114
115log_manager_ext_sources += files(
116 'entry_points.cpp',
117 'extended_user_data.cpp',
118 'host_notifier.cpp',
119 'manager.cpp',
Vijay Lobo2fb10212021-08-22 23:24:16 -0500120 'pel_entry.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500121 'pldm_interface.cpp',
122 'repository.cpp',
123 'src.cpp',
124 'user_data.cpp',
125)
126
127install_data(
128 'registry/message_registry.json',
Matt Spinler8e823e12022-05-02 10:24:10 -0500129 'registry/O_component_ids.json',
Matt Spinler2ef9dc92022-05-02 10:58:11 -0500130 'registry/B_component_ids.json',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500131 install_dir: get_option('datadir') / 'phosphor-logging/pels',
132)
133
134peltool_sources = files(
135 'extended_user_data.cpp',
136 'src.cpp',
137 'user_data.cpp',
138 'user_data_json.cpp',
139)
140
141peltool_deps = [
142 CLI11_dep,
William A. Kennington IIIe0538842021-06-11 02:01:58 -0700143 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500144 python_dep,
145]
146
147executable(
148 'peltool',
149 'tools/peltool.cpp',
150 peltool_sources,
151 cpp_args: [ '-DPELTOOL' ],
152 link_args: [ '-lpython' + python_ver ],
153 include_directories: include_directories('../..'),
154 dependencies: [
155 peltool_deps,
156 libpel_dep,
157 ],
158 install: true,
159)