blob: addfbb84e06a585516da9d823ad0c76519665617 [file] [log] [blame]
Patrick Williams5383d762025-02-01 08:36:24 -05001libpldm_dep = dependency('libpldm', default_options: ['oem-ibm=enabled'])
Patrick Williamsd9f0d642021-04-21 15:43:21 -05002
Patrick Williamsd9f0d642021-04-21 15:43:21 -05003python_inst = import('python').find_installation('python3')
4python_ver = python_inst.language_version()
5python_dep = python_inst.dependency()
6
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -05007extra_sources = []
Jayanth Othayoth4d779b22021-06-03 05:45:13 -05008extra_dependencies = []
William A. Kennington III8fd187e2021-07-26 13:36:56 -07009extra_args = []
Jayanth Othayothbf54cbb2021-06-03 04:36:48 -050010
Patrick Williamsc8ff39d2023-11-29 06:43:49 -060011build_phal = get_option('phal').allowed()
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050012
13if build_phal
14 extra_sources += [
15 'sbe_ffdc_handler.cpp',
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050016 'fapi_data_process.cpp',
Jayanth Othayothda9b5832021-11-05 04:19:43 -050017 'phal_service_actions.cpp',
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050018 ]
19 extra_dependencies += [
20 dependency('libdt-api'),
21 cpp.find_library('pdbg'),
Jayanth Othayothc74c2202021-06-04 06:42:43 -050022 cpp.find_library('ekb'),
Jayanth Othayoth3ef7b602021-11-09 06:40:38 -060023 cpp.find_library('phal'),
Deepa Karthikeyanff35be32024-10-15 09:10:49 -050024 cpp.find_library('libguard'),
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050025 ]
Patrick Williams5383d762025-02-01 08:36:24 -050026 extra_args += ['-DPEL_ENABLE_PHAL']
27 log_manager_ext_args += ['-DPEL_ENABLE_PHAL']
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050028endif
29
Patrick Williamsd9f0d642021-04-21 15:43:21 -050030libpel_sources = files(
Patrick Williams5383d762025-02-01 08:36:24 -050031 extra_sources,
32 '../../paths.cpp',
33 '../../util.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -050034 'ascii_string.cpp',
35 'bcd_time.cpp',
36 'callout.cpp',
37 'callouts.cpp',
38 'data_interface.cpp',
39 'device_callouts.cpp',
40 'extended_user_header.cpp',
41 'failing_mtms.cpp',
42 'fru_identity.cpp',
43 'generic.cpp',
Matt Spinlerd96fa602022-12-15 11:11:26 -060044 'journal.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -050045 'json_utils.cpp',
46 'log_id.cpp',
47 'mru.cpp',
48 'mtms.cpp',
49 'pce_identity.cpp',
50 'pel.cpp',
51 'pel_rules.cpp',
52 'pel_values.cpp',
53 'private_header.cpp',
54 'registry.cpp',
55 'section_factory.cpp',
56 'service_indicators.cpp',
57 'severity.cpp',
Jayanth Othayothbf54cbb2021-06-03 04:36:48 -050058 'temporary_file.cpp',
Patrick Williams5383d762025-02-01 08:36:24 -050059 'user_header.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -050060)
61
62libpel_deps = [
William A. Kennington IIIe0538842021-06-11 02:01:58 -070063 conf_h_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050064 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050065 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050066 sdbusplus_dep,
67 sdeventplus_dep,
68 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050069 phosphor_logging_dep,
Jayanth Othayoth4d779b22021-06-03 05:45:13 -050070 extra_dependencies,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050071]
72
73libpel_lib = static_library(
74 'pel',
75 libpel_sources,
Patrick Williams5383d762025-02-01 08:36:24 -050076 'pel_paths.cpp', # paths is separate because it is overridden during test.
Patrick Williamsd9f0d642021-04-21 15:43:21 -050077 include_directories: include_directories('../..', '../../gen'),
William A. Kennington III8fd187e2021-07-26 13:36:56 -070078 cpp_args: extra_args,
Patrick Williams5383d762025-02-01 08:36:24 -050079 dependencies: [libpel_deps],
Patrick Williamsd9f0d642021-04-21 15:43:21 -050080)
81
82libpel_dep = declare_dependency(
83 include_directories: include_directories('.'),
84 link_with: libpel_lib,
85 dependencies: [
86 libpldm_dep,
Patrick Williamse4a014b2023-07-13 16:32:34 -050087 nlohmann_json_dep,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050088 sdbusplus_dep,
89 sdeventplus_dep,
90 pdi_dep,
Jayanth Othayothebc91be2021-07-27 00:54:31 -050091 phosphor_logging_dep,
Patrick Williams5383d762025-02-01 08:36:24 -050092 ],
Patrick Williamsd9f0d642021-04-21 15:43:21 -050093)
94
Patrick Williams5383d762025-02-01 08:36:24 -050095log_manager_ext_deps += [libpel_dep, libpldm_dep, nlohmann_json_dep]
Patrick Williamsd9f0d642021-04-21 15:43:21 -050096
97log_manager_ext_sources += files(
98 'entry_points.cpp',
99 'extended_user_data.cpp',
100 'host_notifier.cpp',
101 'manager.cpp',
Vijay Lobo2fb10212021-08-22 23:24:16 -0500102 'pel_entry.cpp',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500103 'pldm_interface.cpp',
104 'repository.cpp',
105 'src.cpp',
106 'user_data.cpp',
107)
108
109install_data(
110 'registry/message_registry.json',
Matt Spinler8e823e12022-05-02 10:24:10 -0500111 'registry/O_component_ids.json',
Matt Spinler2ef9dc92022-05-02 10:58:11 -0500112 'registry/B_component_ids.json',
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500113 install_dir: get_option('datadir') / 'phosphor-logging/pels',
114)
115
116peltool_sources = files(
117 'extended_user_data.cpp',
118 'src.cpp',
119 'user_data.cpp',
120 'user_data_json.cpp',
121)
122
Patrick Williams5383d762025-02-01 08:36:24 -0500123peltool_deps = [CLI11_dep, conf_h_dep, python_dep]
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500124
125executable(
126 'peltool',
127 'tools/peltool.cpp',
128 peltool_sources,
Patrick Williams5383d762025-02-01 08:36:24 -0500129 cpp_args: ['-DPELTOOL'],
130 link_args: ['-lpython' + python_ver],
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500131 include_directories: include_directories('../..'),
Patrick Williams5383d762025-02-01 08:36:24 -0500132 dependencies: [peltool_deps, libpel_dep],
Patrick Williamsd9f0d642021-04-21 15:43:21 -0500133 install: true,
134)