blob: db575688d883b8625bbebb303dc04f7fe37a9b28 [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',
Patrick Williamsfa2d9622024-09-30 16:25:43 -040071 '../../paths.cpp',
Arya K Padmand8ae6182024-07-19 06:25:10 -050072 '../../util.cpp',
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050073 extra_sources,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050074)
75
76libpel_deps = [
William A. Kennington IIIe0538842021-06-11 02:01:58 -070077 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050078 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050079 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050080 sdbusplus_dep,
81 sdeventplus_dep,
82 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050083 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050084 extra_dependencies,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050085]
86
87libpel_lib = static_library(
88 'pel',
89 libpel_sources,
Patrick Williamsfa2d9622024-09-30 16:25:43 -040090 'pel_paths.cpp', # paths is separate because it is overridden during test.
Patrick Williamsd9f0d642021-04-21 15:43:21 -050091 include_directories: include_directories('../..', '../../gen'),
William A. Kennington III8fd187e2021-07-26 13:36:56 -070092 cpp_args: extra_args,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050093 dependencies: [
94 libpel_deps,
95 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -050096)
97
98libpel_dep = declare_dependency(
99 include_directories: include_directories('.'),
100 link_with: libpel_lib,
101 dependencies: [
102 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500103 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500104 sdbusplus_dep,
105 sdeventplus_dep,
106 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -0500107 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -0500108 ]
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500109)
110
111log_manager_ext_deps += [
112 libpel_dep,
113 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -0500114 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500115]
116
117log_manager_ext_sources += files(
118 'entry_points.cpp',
119 'extended_user_data.cpp',
120 'host_notifier.cpp',
121 'manager.cpp',
Vijay Lobo2fb10212021-08-22 23:24:16 -0500122 'pel_entry.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500123 'pldm_interface.cpp',
124 'repository.cpp',
125 'src.cpp',
126 'user_data.cpp',
127)
128
129install_data(
130 'registry/message_registry.json',
Matt Spinler8e823e12022-05-02 10:24:10 -0500131 'registry/O_component_ids.json',
Matt Spinler2ef9dc92022-05-02 10:58:11 -0500132 'registry/B_component_ids.json',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500133 install_dir: get_option('datadir') / 'phosphor-logging/pels',
134)
135
136peltool_sources = files(
137 'extended_user_data.cpp',
138 'src.cpp',
139 'user_data.cpp',
140 'user_data_json.cpp',
141)
142
143peltool_deps = [
144 CLI11_dep,
William A. Kennington IIIe0538842021-06-11 02:01:58 -0700145 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500146 python_dep,
147]
148
149executable(
150 'peltool',
151 'tools/peltool.cpp',
152 peltool_sources,
153 cpp_args: [ '-DPELTOOL' ],
154 link_args: [ '-lpython' + python_ver ],
155 include_directories: include_directories('../..'),
156 dependencies: [
157 peltool_deps,
158 libpel_dep,
159 ],
160 install: true,
161)