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