blob: 068f8700bc8ba1d9fa8719ca26def4af7f57b780 [file] [log] [blame]
Patrick Williamsd9f0d642021-04-21 15:43:21 -05001libpldm_dep = dependency(
2 'libpldm',
3 fallback: ['pldm', 'libpldm_dep'],
4 default_options: ['libpldm-only=enabled', 'oem-ibm=enabled'],
5)
6
7if cpp.has_header('nlohmann/json.hpp')
8 nlohmann_json = declare_dependency()
9else
10 subproject('nlohmann-json')
11 nlohmann_json = declare_dependency(
12 include_directories: include_directories(
13 '../../subprojects/nlohmann-json/single_include',
14 '../../subprojects/nlohmann-json/single_include/nlohmann',
15 )
16 )
17endif
18
19python_inst = import('python').find_installation('python3')
20python_ver = python_inst.language_version()
21python_dep = python_inst.dependency()
22
23if cpp.has_header('CLI/CLI.hpp')
24 CLI11_dep = declare_dependency()
25else
26 CLI11_dep = dependency(
27 'CLI11',
28 fallback: [ 'CLI11', 'CLI11_dep' ],
29 )
30endif
31
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050032extra_sources = []
33build_phal = get_option('phal').enabled()
34
35if build_phal
36 extra_sources += [
37 'sbe_ffdc_handler.cpp',
38 ]
39 add_project_arguments('-DSBE_FFDC_SUPPORTED', language : ['c','cpp'])
40endif
41
Patrick Williamsd9f0d642021-04-21 15:43:21 -050042libpel_sources = files(
43 'ascii_string.cpp',
44 'bcd_time.cpp',
45 'callout.cpp',
46 'callouts.cpp',
47 'data_interface.cpp',
48 'device_callouts.cpp',
49 'extended_user_header.cpp',
50 'failing_mtms.cpp',
51 'fru_identity.cpp',
52 'generic.cpp',
53 'json_utils.cpp',
54 'log_id.cpp',
55 'mru.cpp',
56 'mtms.cpp',
57 'pce_identity.cpp',
58 'pel.cpp',
59 'pel_rules.cpp',
60 'pel_values.cpp',
61 'private_header.cpp',
62 'registry.cpp',
63 'section_factory.cpp',
64 'service_indicators.cpp',
65 'severity.cpp',
66 'user_header.cpp',
Jayanth Othayothe8bdeea2021-06-03 03:01:16 -050067 extra_sources,
Patrick Williamsd9f0d642021-04-21 15:43:21 -050068)
69
70libpel_deps = [
71 libpldm_dep,
72 nlohmann_json,
73 sdbusplus_dep,
74 sdeventplus_dep,
75 pdi_dep,
76]
77
78libpel_lib = static_library(
79 'pel',
80 libpel_sources,
81 'paths.cpp', # paths is separate because it is overridden during test.
82 include_directories: include_directories('../..', '../../gen'),
83 dependencies: libpel_deps,
84)
85
86libpel_dep = declare_dependency(
87 include_directories: include_directories('.'),
88 link_with: libpel_lib,
89 dependencies: [
90 libpldm_dep,
91 nlohmann_json,
92 sdbusplus_dep,
93 sdeventplus_dep,
94 pdi_dep,
95 ],
96
97)
98
99log_manager_ext_deps += [
100 libpel_dep,
101 libpldm_dep,
102 nlohmann_json,
103]
104
105log_manager_ext_sources += files(
106 'entry_points.cpp',
107 'extended_user_data.cpp',
108 'host_notifier.cpp',
109 'manager.cpp',
110 'pldm_interface.cpp',
111 'repository.cpp',
112 'src.cpp',
113 'user_data.cpp',
114)
115
116install_data(
117 'registry/message_registry.json',
118 install_dir: get_option('datadir') / 'phosphor-logging/pels',
119)
120
121peltool_sources = files(
122 'extended_user_data.cpp',
123 'src.cpp',
124 'user_data.cpp',
125 'user_data_json.cpp',
126)
127
128peltool_deps = [
129 CLI11_dep,
130 python_dep,
131]
132
133executable(
134 'peltool',
135 'tools/peltool.cpp',
136 peltool_sources,
137 cpp_args: [ '-DPELTOOL' ],
138 link_args: [ '-lpython' + python_ver ],
139 include_directories: include_directories('../..'),
140 dependencies: [
141 peltool_deps,
142 libpel_dep,
143 ],
144 install: true,
145)