1libpldm_dep = dependency( 2 'libpldm', 3 default_options: ['oem-ibm=enabled'], 4) 5 6nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') 7 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 15 CLI11_dep = dependency('CLI11') 16endif 17 18extra_sources = [] 19extra_dependencies = [] 20extra_args = [] 21 22build_phal = get_option('phal').allowed() 23 24if build_phal 25 extra_sources += [ 26 'sbe_ffdc_handler.cpp', 27 'fapi_data_process.cpp', 28 'phal_service_actions.cpp', 29 ] 30 extra_dependencies += [ 31 dependency('libdt-api'), 32 cpp.find_library('pdbg'), 33 cpp.find_library('ekb'), 34 cpp.find_library('phal'), 35 cpp.find_library('libguard'), 36 ] 37 extra_args += [ 38 '-DPEL_ENABLE_PHAL', 39 ] 40 log_manager_ext_args += [ 41 '-DPEL_ENABLE_PHAL', 42 ] 43endif 44 45libpel_sources = files( 46 'ascii_string.cpp', 47 'bcd_time.cpp', 48 'callout.cpp', 49 'callouts.cpp', 50 'data_interface.cpp', 51 'device_callouts.cpp', 52 'extended_user_header.cpp', 53 'failing_mtms.cpp', 54 'fru_identity.cpp', 55 'generic.cpp', 56 'journal.cpp', 57 'json_utils.cpp', 58 'log_id.cpp', 59 'mru.cpp', 60 'mtms.cpp', 61 'pce_identity.cpp', 62 'pel.cpp', 63 'pel_rules.cpp', 64 'pel_values.cpp', 65 'private_header.cpp', 66 'registry.cpp', 67 'section_factory.cpp', 68 'service_indicators.cpp', 69 'severity.cpp', 70 'user_header.cpp', 71 'temporary_file.cpp', 72 '../../paths.cpp', 73 '../../util.cpp', 74 extra_sources, 75) 76 77libpel_deps = [ 78 conf_h_dep, 79 libpldm_dep, 80 nlohmann_json_dep, 81 sdbusplus_dep, 82 sdeventplus_dep, 83 pdi_dep, 84 phosphor_logging_dep, 85 extra_dependencies, 86] 87 88libpel_lib = static_library( 89 'pel', 90 libpel_sources, 91 'pel_paths.cpp', # paths is separate because it is overridden during test. 92 include_directories: include_directories('../..', '../../gen'), 93 cpp_args: extra_args, 94 dependencies: [ 95 libpel_deps, 96 ] 97) 98 99libpel_dep = declare_dependency( 100 include_directories: include_directories('.'), 101 link_with: libpel_lib, 102 dependencies: [ 103 libpldm_dep, 104 nlohmann_json_dep, 105 sdbusplus_dep, 106 sdeventplus_dep, 107 pdi_dep, 108 phosphor_logging_dep, 109 ] 110) 111 112log_manager_ext_deps += [ 113 libpel_dep, 114 libpldm_dep, 115 nlohmann_json_dep, 116] 117 118log_manager_ext_sources += files( 119 'entry_points.cpp', 120 'extended_user_data.cpp', 121 'host_notifier.cpp', 122 'manager.cpp', 123 'pel_entry.cpp', 124 'pldm_interface.cpp', 125 'repository.cpp', 126 'src.cpp', 127 'user_data.cpp', 128) 129 130install_data( 131 'registry/message_registry.json', 132 'registry/O_component_ids.json', 133 'registry/B_component_ids.json', 134 install_dir: get_option('datadir') / 'phosphor-logging/pels', 135) 136 137peltool_sources = files( 138 'extended_user_data.cpp', 139 'src.cpp', 140 'user_data.cpp', 141 'user_data_json.cpp', 142) 143 144peltool_deps = [ 145 CLI11_dep, 146 conf_h_dep, 147 python_dep, 148] 149 150executable( 151 'peltool', 152 'tools/peltool.cpp', 153 peltool_sources, 154 cpp_args: [ '-DPELTOOL' ], 155 link_args: [ '-lpython' + python_ver ], 156 include_directories: include_directories('../..'), 157 dependencies: [ 158 peltool_deps, 159 libpel_dep, 160 ], 161 install: true, 162) 163