blob: f0750042d55be3f30ee5477b02196bed19a92965 [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 Williamsd9f0d642021-04-21 15:43:21 -05006python_inst = import('python').find_installation('python3')
7python_ver = python_inst.language_version()
8python_dep = python_inst.dependency()
9
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050010extra_sources = []
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050011extra_dependencies = []
William A. Kennington III8fd187e2021-07-26 13:36:56 -070012extra_args = []
Jayanth Othayothbf54cbb2021-06-03 04:36:48 -050013
Patrick Williamsc8ff39d2023-11-29 06:43:49 -060014build_phal = get_option('phal').allowed()
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050015
16if build_phal
17 extra_sources += [
18 'sbe_ffdc_handler.cpp',
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050019 'fapi_data_process.cpp',
Jayanth Othayothda9b5832021-11-05 04:19:43 -050020 'phal_service_actions.cpp',
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050021 ]
22 extra_dependencies += [
23 dependency('libdt-api'),
24 cpp.find_library('pdbg'),
Jayanth Othayothc74c2202021-06-04 06:42:43 -050025 cpp.find_library('ekb'),
Jayanth Othayoth3ef7b602021-11-09 06:40:38 -060026 cpp.find_library('phal'),
Deepa Karthikeyanff35be32024-10-15 09:10:49 -050027 cpp.find_library('libguard'),
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050028 ]
William A. Kennington III8fd187e2021-07-26 13:36:56 -070029 extra_args += [
Jayanth Othayoth92b20662021-11-05 00:09:15 -050030 '-DPEL_ENABLE_PHAL',
William A. Kennington III8fd187e2021-07-26 13:36:56 -070031 ]
32 log_manager_ext_args += [
Jayanth Othayoth92b20662021-11-05 00:09:15 -050033 '-DPEL_ENABLE_PHAL',
William A. Kennington III8fd187e2021-07-26 13:36:56 -070034 ]
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050035endif
36
Patrick Williamsd9f0d642021-04-21 15:43:21 -050037libpel_sources = files(
38 'ascii_string.cpp',
39 'bcd_time.cpp',
40 'callout.cpp',
41 'callouts.cpp',
42 'data_interface.cpp',
43 'device_callouts.cpp',
44 'extended_user_header.cpp',
45 'failing_mtms.cpp',
46 'fru_identity.cpp',
47 'generic.cpp',
Matt Spinlerd96fa602022-12-15 11:11:26 -060048 'journal.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -050049 'json_utils.cpp',
50 'log_id.cpp',
51 'mru.cpp',
52 'mtms.cpp',
53 'pce_identity.cpp',
54 'pel.cpp',
55 'pel_rules.cpp',
56 'pel_values.cpp',
57 'private_header.cpp',
58 'registry.cpp',
59 'section_factory.cpp',
60 'service_indicators.cpp',
61 'severity.cpp',
62 'user_header.cpp',
Jayanth Othayothbf54cbb2021-06-03 04:36:48 -050063 'temporary_file.cpp',
Patrick Williamsfa2d9622024-09-30 16:25:43 -040064 '../../paths.cpp',
Arya K Padmand8ae6182024-07-19 06:25:10 -050065 '../../util.cpp',
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050066 extra_sources,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050067)
68
69libpel_deps = [
William A. Kennington IIIe0538842021-06-11 02:01:58 -070070 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050071 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050072 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050073 sdbusplus_dep,
74 sdeventplus_dep,
75 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050076 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050077 extra_dependencies,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050078]
79
80libpel_lib = static_library(
81 'pel',
82 libpel_sources,
Patrick Williamsfa2d9622024-09-30 16:25:43 -040083 'pel_paths.cpp', # paths is separate because it is overridden during test.
Patrick Williamsd9f0d642021-04-21 15:43:21 -050084 include_directories: include_directories('../..', '../../gen'),
William A. Kennington III8fd187e2021-07-26 13:36:56 -070085 cpp_args: extra_args,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050086 dependencies: [
87 libpel_deps,
88 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -050089)
90
91libpel_dep = declare_dependency(
92 include_directories: include_directories('.'),
93 link_with: libpel_lib,
94 dependencies: [
95 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050096 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050097 sdbusplus_dep,
98 sdeventplus_dep,
99 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -0500100 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -0500101 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500102)
103
104log_manager_ext_deps += [
105 libpel_dep,
106 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500107 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500108]
109
110log_manager_ext_sources += files(
111 'entry_points.cpp',
112 'extended_user_data.cpp',
113 'host_notifier.cpp',
114 'manager.cpp',
Vijay Lobo2fb10212021-08-22 23:24:16 -0500115 'pel_entry.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500116 'pldm_interface.cpp',
117 'repository.cpp',
118 'src.cpp',
119 'user_data.cpp',
120)
121
122install_data(
123 'registry/message_registry.json',
Matt Spinler8e823e12022-05-02 10:24:10 -0500124 'registry/O_component_ids.json',
Matt Spinler2ef9dc92022-05-02 10:58:11 -0500125 'registry/B_component_ids.json',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500126 install_dir: get_option('datadir') / 'phosphor-logging/pels',
127)
128
129peltool_sources = files(
130 'extended_user_data.cpp',
131 'src.cpp',
132 'user_data.cpp',
133 'user_data_json.cpp',
134)
135
136peltool_deps = [
137 CLI11_dep,
William A. Kennington IIIe0538842021-06-11 02:01:58 -0700138 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500139 python_dep,
140]
141
142executable(
143 'peltool',
144 'tools/peltool.cpp',
145 peltool_sources,
146 cpp_args: [ '-DPELTOOL' ],
147 link_args: [ '-lpython' + python_ver ],
148 include_directories: include_directories('../..'),
149 dependencies: [
150 peltool_deps,
151 libpel_dep,
152 ],
153 install: true,
154)