Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 1 | libpldm_dep = dependency( |
| 2 | 'libpldm', |
Matt Spinler | 1a6b311 | 2023-05-05 10:17:08 -0500 | [diff] [blame] | 3 | default_options: ['oem-ibm=enabled'], |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 4 | ) |
| 5 | |
Patrick Williams | 11565fe | 2023-12-07 12:19:01 -0600 | [diff] [blame] | 6 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 7 | |
| 8 | python_inst = import('python').find_installation('python3') |
| 9 | python_ver = python_inst.language_version() |
| 10 | python_dep = python_inst.dependency() |
| 11 | |
| 12 | if cpp.has_header('CLI/CLI.hpp') |
| 13 | CLI11_dep = declare_dependency() |
| 14 | else |
Patrick Williams | 62bc968 | 2022-03-21 09:23:11 -0500 | [diff] [blame] | 15 | CLI11_dep = dependency('CLI11') |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 16 | endif |
| 17 | |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 18 | extra_sources = [] |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 19 | extra_dependencies = [] |
William A. Kennington III | 8fd187e | 2021-07-26 13:36:56 -0700 | [diff] [blame] | 20 | extra_args = [] |
Jayanth Othayoth | bf54cbb | 2021-06-03 04:36:48 -0500 | [diff] [blame] | 21 | |
Patrick Williams | c8ff39d | 2023-11-29 06:43:49 -0600 | [diff] [blame] | 22 | build_phal = get_option('phal').allowed() |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 23 | |
| 24 | if build_phal |
| 25 | extra_sources += [ |
| 26 | 'sbe_ffdc_handler.cpp', |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 27 | 'fapi_data_process.cpp', |
Jayanth Othayoth | da9b583 | 2021-11-05 04:19:43 -0500 | [diff] [blame] | 28 | 'phal_service_actions.cpp', |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 29 | ] |
| 30 | extra_dependencies += [ |
| 31 | dependency('libdt-api'), |
| 32 | cpp.find_library('pdbg'), |
Jayanth Othayoth | c74c220 | 2021-06-04 06:42:43 -0500 | [diff] [blame] | 33 | cpp.find_library('ekb'), |
Jayanth Othayoth | 3ef7b60 | 2021-11-09 06:40:38 -0600 | [diff] [blame] | 34 | cpp.find_library('phal'), |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 35 | ] |
William A. Kennington III | 8fd187e | 2021-07-26 13:36:56 -0700 | [diff] [blame] | 36 | extra_args += [ |
Jayanth Othayoth | 92b2066 | 2021-11-05 00:09:15 -0500 | [diff] [blame] | 37 | '-DPEL_ENABLE_PHAL', |
William A. Kennington III | 8fd187e | 2021-07-26 13:36:56 -0700 | [diff] [blame] | 38 | ] |
| 39 | log_manager_ext_args += [ |
Jayanth Othayoth | 92b2066 | 2021-11-05 00:09:15 -0500 | [diff] [blame] | 40 | '-DPEL_ENABLE_PHAL', |
William A. Kennington III | 8fd187e | 2021-07-26 13:36:56 -0700 | [diff] [blame] | 41 | ] |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 42 | endif |
| 43 | |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 44 | libpel_sources = files( |
| 45 | 'ascii_string.cpp', |
| 46 | 'bcd_time.cpp', |
| 47 | 'callout.cpp', |
| 48 | 'callouts.cpp', |
| 49 | 'data_interface.cpp', |
| 50 | 'device_callouts.cpp', |
| 51 | 'extended_user_header.cpp', |
| 52 | 'failing_mtms.cpp', |
| 53 | 'fru_identity.cpp', |
| 54 | 'generic.cpp', |
Matt Spinler | d96fa60 | 2022-12-15 11:11:26 -0600 | [diff] [blame] | 55 | 'journal.cpp', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 56 | 'json_utils.cpp', |
| 57 | 'log_id.cpp', |
| 58 | 'mru.cpp', |
| 59 | 'mtms.cpp', |
| 60 | 'pce_identity.cpp', |
| 61 | 'pel.cpp', |
| 62 | 'pel_rules.cpp', |
| 63 | 'pel_values.cpp', |
| 64 | 'private_header.cpp', |
| 65 | 'registry.cpp', |
| 66 | 'section_factory.cpp', |
| 67 | 'service_indicators.cpp', |
| 68 | 'severity.cpp', |
| 69 | 'user_header.cpp', |
Jayanth Othayoth | bf54cbb | 2021-06-03 04:36:48 -0500 | [diff] [blame] | 70 | 'temporary_file.cpp', |
Jayanth Othayoth | e8bdeea | 2021-06-03 03:01:16 -0500 | [diff] [blame] | 71 | extra_sources, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 72 | ) |
| 73 | |
| 74 | libpel_deps = [ |
William A. Kennington III | e053884 | 2021-06-11 02:01:58 -0700 | [diff] [blame] | 75 | conf_h_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 76 | libpldm_dep, |
Patrick Williams | e4a014b | 2023-07-13 16:32:34 -0500 | [diff] [blame] | 77 | nlohmann_json_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 78 | sdbusplus_dep, |
| 79 | sdeventplus_dep, |
| 80 | pdi_dep, |
Jayanth Othayoth | ebc91be | 2021-07-27 00:54:31 -0500 | [diff] [blame] | 81 | phosphor_logging_dep, |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 82 | extra_dependencies, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 83 | ] |
| 84 | |
| 85 | libpel_lib = static_library( |
| 86 | 'pel', |
| 87 | libpel_sources, |
| 88 | 'paths.cpp', # paths is separate because it is overridden during test. |
| 89 | include_directories: include_directories('../..', '../../gen'), |
William A. Kennington III | 8fd187e | 2021-07-26 13:36:56 -0700 | [diff] [blame] | 90 | cpp_args: extra_args, |
Jayanth Othayoth | ebc91be | 2021-07-27 00:54:31 -0500 | [diff] [blame] | 91 | dependencies: [ |
| 92 | libpel_deps, |
| 93 | ] |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 94 | ) |
| 95 | |
| 96 | libpel_dep = declare_dependency( |
| 97 | include_directories: include_directories('.'), |
| 98 | link_with: libpel_lib, |
| 99 | dependencies: [ |
| 100 | libpldm_dep, |
Patrick Williams | e4a014b | 2023-07-13 16:32:34 -0500 | [diff] [blame] | 101 | nlohmann_json_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 102 | sdbusplus_dep, |
| 103 | sdeventplus_dep, |
| 104 | pdi_dep, |
Jayanth Othayoth | ebc91be | 2021-07-27 00:54:31 -0500 | [diff] [blame] | 105 | phosphor_logging_dep, |
Jayanth Othayoth | 4d779b2 | 2021-06-03 05:45:13 -0500 | [diff] [blame] | 106 | ] |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 107 | ) |
| 108 | |
| 109 | log_manager_ext_deps += [ |
| 110 | libpel_dep, |
| 111 | libpldm_dep, |
Patrick Williams | e4a014b | 2023-07-13 16:32:34 -0500 | [diff] [blame] | 112 | nlohmann_json_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 113 | ] |
| 114 | |
| 115 | log_manager_ext_sources += files( |
| 116 | 'entry_points.cpp', |
| 117 | 'extended_user_data.cpp', |
| 118 | 'host_notifier.cpp', |
| 119 | 'manager.cpp', |
Vijay Lobo | 2fb1021 | 2021-08-22 23:24:16 -0500 | [diff] [blame] | 120 | 'pel_entry.cpp', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 121 | 'pldm_interface.cpp', |
| 122 | 'repository.cpp', |
| 123 | 'src.cpp', |
| 124 | 'user_data.cpp', |
| 125 | ) |
| 126 | |
| 127 | install_data( |
| 128 | 'registry/message_registry.json', |
Matt Spinler | 8e823e1 | 2022-05-02 10:24:10 -0500 | [diff] [blame] | 129 | 'registry/O_component_ids.json', |
Matt Spinler | 2ef9dc9 | 2022-05-02 10:58:11 -0500 | [diff] [blame] | 130 | 'registry/B_component_ids.json', |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 131 | install_dir: get_option('datadir') / 'phosphor-logging/pels', |
| 132 | ) |
| 133 | |
| 134 | peltool_sources = files( |
| 135 | 'extended_user_data.cpp', |
| 136 | 'src.cpp', |
| 137 | 'user_data.cpp', |
| 138 | 'user_data_json.cpp', |
| 139 | ) |
| 140 | |
| 141 | peltool_deps = [ |
| 142 | CLI11_dep, |
William A. Kennington III | e053884 | 2021-06-11 02:01:58 -0700 | [diff] [blame] | 143 | conf_h_dep, |
Patrick Williams | d9f0d64 | 2021-04-21 15:43:21 -0500 | [diff] [blame] | 144 | python_dep, |
| 145 | ] |
| 146 | |
| 147 | executable( |
| 148 | 'peltool', |
| 149 | 'tools/peltool.cpp', |
| 150 | peltool_sources, |
| 151 | cpp_args: [ '-DPELTOOL' ], |
| 152 | link_args: [ '-lpython' + python_ver ], |
| 153 | include_directories: include_directories('../..'), |
| 154 | dependencies: [ |
| 155 | peltool_deps, |
| 156 | libpel_dep, |
| 157 | ], |
| 158 | install: true, |
| 159 | ) |