Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 1 | libpldm_dep = dependency('libpldm', default_options: ['oem-ibm=enabled']) |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 2 | |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 3 | python_inst = import('python').find_installation('python3') |
| 4 | python_ver = python_inst.language_version() |
| 5 | python_dep = python_inst.dependency() |
| 6 | |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 7 | extra_sources = [] |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 8 | extra_dependencies = [] |
William A. Kennington III | 8fd187e | 2021-07-26 13:36:56 -0700 | [diff] [blame] | 9 | extra_args = [] |
Jayanth Othayoth | bf54cbb | 2021-06-03 04:36:48 -0500 | [diff] [blame] | 10 | |
Patrick Williams | c8ff39d | 2023-11-29 06:43:49 -0600 | [diff] [blame] | 11 | build_phal = get_option('phal').allowed() |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 12 | |
| 13 | if build_phal |
| 14 | extra_sources += [ |
| 15 | 'sbe_ffdc_handler.cpp', |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 16 | 'fapi_data_process.cpp', |
Jayanth Othayoth | da9b583 | 2021-11-05 04:19:43 -0500 | [diff] [blame] | 17 | 'phal_service_actions.cpp', |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 18 | ] |
| 19 | extra_dependencies += [ |
| 20 | dependency('libdt-api'), |
| 21 | cpp.find_library('pdbg'), |
Jayanth Othayoth | c74c220 | 2021-06-04 06:42:43 -0500 | [diff] [blame] | 22 | cpp.find_library('ekb'), |
Jayanth Othayoth | 3ef7b60 | 2021-11-09 06:40:38 -0600 | [diff] [blame] | 23 | cpp.find_library('phal'), |
Deepa Karthikeyan | ff35be3 | 2024-10-15 09:10:49 -0500 | [diff] [blame] | 24 | cpp.find_library('libguard'), |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 25 | ] |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 26 | extra_args += ['-DPEL_ENABLE_PHAL'] |
| 27 | log_manager_ext_args += ['-DPEL_ENABLE_PHAL'] |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 28 | endif |
| 29 | |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 30 | libpel_sources = files( |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 31 | extra_sources, |
| 32 | '../../paths.cpp', |
| 33 | '../../util.cpp', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 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', |
Matt Spinler | d96fa60 | 2022-12-15 11:11:26 -0600 | [diff] [blame] | 44 | 'journal.cpp', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 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', |
Jayanth Othayoth | bf54cbb | 2021-06-03 04:36:48 -0500 | [diff] [blame] | 58 | 'temporary_file.cpp', |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 59 | 'user_header.cpp', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 60 | ) |
| 61 | |
| 62 | libpel_deps = [ |
William A. Kennington III | e053884 | 2021-06-11 02:01:58 -0700 | [diff] [blame] | 63 | conf_h_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 64 | libpldm_dep, |
Patrick Williams | e4a014b | 2023-07-13 16:32:34 -0500 | [diff] [blame] | 65 | nlohmann_json_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 66 | sdbusplus_dep, |
| 67 | sdeventplus_dep, |
| 68 | pdi_dep, |
Jayanth Othayoth | ebc91be | 2021-07-27 00:54:31 -0500 | [diff] [blame] | 69 | phosphor_logging_dep, |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 70 | extra_dependencies, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 71 | ] |
| 72 | |
| 73 | libpel_lib = static_library( |
| 74 | 'pel', |
| 75 | libpel_sources, |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 76 | 'pel_paths.cpp', # paths is separate because it is overridden during test. |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 77 | include_directories: include_directories('../..', '../../gen'), |
William A. Kennington III | 8fd187e | 2021-07-26 13:36:56 -0700 | [diff] [blame] | 78 | cpp_args: extra_args, |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 79 | dependencies: [libpel_deps], |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 80 | ) |
| 81 | |
| 82 | libpel_dep = declare_dependency( |
| 83 | include_directories: include_directories('.'), |
| 84 | link_with: libpel_lib, |
| 85 | dependencies: [ |
| 86 | libpldm_dep, |
Patrick Williams | e4a014b | 2023-07-13 16:32:34 -0500 | [diff] [blame] | 87 | nlohmann_json_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 88 | sdbusplus_dep, |
| 89 | sdeventplus_dep, |
| 90 | pdi_dep, |
Jayanth Othayoth | ebc91be | 2021-07-27 00:54:31 -0500 | [diff] [blame] | 91 | phosphor_logging_dep, |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 92 | ], |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 93 | ) |
| 94 | |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 95 | log_manager_ext_deps += [libpel_dep, libpldm_dep, nlohmann_json_dep] |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 96 | |
| 97 | log_manager_ext_sources += files( |
| 98 | 'entry_points.cpp', |
| 99 | 'extended_user_data.cpp', |
| 100 | 'host_notifier.cpp', |
| 101 | 'manager.cpp', |
Vijay Lobo | 2fb1021 | 2021-08-22 23:24:16 -0500 | [diff] [blame] | 102 | 'pel_entry.cpp', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 103 | 'pldm_interface.cpp', |
| 104 | 'repository.cpp', |
| 105 | 'src.cpp', |
| 106 | 'user_data.cpp', |
| 107 | ) |
| 108 | |
| 109 | install_data( |
| 110 | 'registry/message_registry.json', |
Matt Spinler | 8e823e1 | 2022-05-02 10:24:10 -0500 | [diff] [blame] | 111 | 'registry/O_component_ids.json', |
Matt Spinler | 2ef9dc9 | 2022-05-02 10:58:11 -0500 | [diff] [blame] | 112 | 'registry/B_component_ids.json', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 113 | install_dir: get_option('datadir') / 'phosphor-logging/pels', |
| 114 | ) |
| 115 | |
| 116 | peltool_sources = files( |
| 117 | 'extended_user_data.cpp', |
| 118 | 'src.cpp', |
| 119 | 'user_data.cpp', |
| 120 | 'user_data_json.cpp', |
| 121 | ) |
| 122 | |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 123 | peltool_deps = [CLI11_dep, conf_h_dep, python_dep] |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 124 | |
| 125 | executable( |
| 126 | 'peltool', |
| 127 | 'tools/peltool.cpp', |
| 128 | peltool_sources, |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 129 | cpp_args: ['-DPELTOOL'], |
| 130 | link_args: ['-lpython' + python_ver], |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 131 | include_directories: include_directories('../..'), |
Patrick Williams | 5383d76 | 2025-02-01 08:36:24 -0500 | [diff] [blame^] | 132 | dependencies: [peltool_deps, libpel_dep], |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 133 | install: true, |
| 134 | ) |