xref: /openbmc/phosphor-logging/extensions/openpower-pels/meson.build (revision d903057338a9bac97d06c9d8f6bbebc5b7478179)
1libpldm_dep = dependency('libpldm', default_options: ['oem=ibm'])
2
3python_inst = import('python').find_installation('python3')
4python_ver = python_inst.language_version()
5python_dep = python_inst.dependency()
6
7extra_sources = []
8extra_dependencies = []
9extra_args = []
10
11build_phal = get_option('phal').allowed()
12
13if build_phal
14    extra_sources += [
15        'sbe_ffdc_handler.cpp',
16        'fapi_data_process.cpp',
17        'phal_service_actions.cpp',
18    ]
19    extra_dependencies += [
20        dependency('libdt-api'),
21        cpp.find_library('pdbg'),
22        cpp.find_library('ekb'),
23        cpp.find_library('phal'),
24        cpp.find_library('libguard'),
25    ]
26    extra_args += ['-DPEL_ENABLE_PHAL']
27    log_manager_ext_args += ['-DPEL_ENABLE_PHAL']
28endif
29
30libpel_sources = files(
31    extra_sources,
32    '../../paths.cpp',
33    '../../util.cpp',
34    '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',
44    'journal.cpp',
45    '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',
58    'temporary_file.cpp',
59    'user_header.cpp',
60)
61
62libpel_deps = [
63    conf_h_dep,
64    libpldm_dep,
65    nlohmann_json_dep,
66    sdbusplus_dep,
67    sdeventplus_dep,
68    pdi_dep,
69    phosphor_logging_dep,
70    extra_dependencies,
71]
72
73libpel_lib = static_library(
74    'pel',
75    libpel_sources,
76    'pel_paths.cpp',  # paths is separate because it is overridden during test.
77    include_directories: include_directories('../..', '../../gen'),
78    cpp_args: extra_args,
79    dependencies: [libpel_deps],
80)
81
82libpel_dep = declare_dependency(
83    include_directories: include_directories('.'),
84    link_with: libpel_lib,
85    dependencies: [
86        libpldm_dep,
87        nlohmann_json_dep,
88        sdbusplus_dep,
89        sdeventplus_dep,
90        pdi_dep,
91        phosphor_logging_dep,
92    ],
93)
94
95log_manager_ext_deps += [libpel_dep, libpldm_dep, nlohmann_json_dep]
96
97log_manager_ext_sources += files(
98    'entry_points.cpp',
99    'extended_user_data.cpp',
100    'host_notifier.cpp',
101    'manager.cpp',
102    'pel_entry.cpp',
103    'pldm_interface.cpp',
104    'repository.cpp',
105    'src.cpp',
106    'user_data.cpp',
107)
108
109install_data(
110    'registry/message_registry.json',
111    'registry/O_component_ids.json',
112    'registry/B_component_ids.json',
113    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
123peltool_deps = [CLI11_dep, conf_h_dep, python_dep]
124
125executable(
126    'peltool',
127    'tools/peltool.cpp',
128    peltool_sources,
129    cpp_args: ['-DPELTOOL'],
130    link_args: ['-lpython' + python_ver],
131    include_directories: include_directories('../..'),
132    dependencies: [peltool_deps, libpel_dep],
133    install: true,
134)
135