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