Pavithra Barithaya | a7989cd | 2023-10-30 08:52:28 -0500 | [diff] [blame] | 1 | libpldm_sources = files( |
Andrew Jeffery | 9c76679 | 2022-08-10 23:12:49 +0930 | [diff] [blame] | 2 | 'base.c', |
| 3 | 'bios.c', |
| 4 | 'platform.c', |
| 5 | 'bios_table.c', |
| 6 | 'firmware_update.c', |
| 7 | 'fru.c', |
| 8 | 'pdr.c', |
Andrew Jeffery | cc45aed | 2023-09-10 23:03:29 +0930 | [diff] [blame] | 9 | 'responder.c', |
Andrew Jeffery | 9c76679 | 2022-08-10 23:12:49 +0930 | [diff] [blame] | 10 | 'utils.c' |
| 11 | ) |
| 12 | |
Andrew Jeffery | 55e5e0a | 2023-06-05 12:33:16 +0930 | [diff] [blame] | 13 | subdir('requester') |
| 14 | subdir('transport') |
| 15 | |
Andrew Jeffery | 8de8e1e | 2023-06-09 14:37:18 +0930 | [diff] [blame] | 16 | if get_option('oem-ibm').allowed() |
Andrew Jeffery | 9c76679 | 2022-08-10 23:12:49 +0930 | [diff] [blame] | 17 | subdir('oem/ibm') |
| 18 | endif |
Pavithra Barithaya | a7989cd | 2023-10-30 08:52:28 -0500 | [diff] [blame] | 19 | |
| 20 | libpldm = library( |
| 21 | 'pldm', |
| 22 | libpldm_sources, |
| 23 | implicit_include_directories: false, |
| 24 | include_directories: [ |
| 25 | libpldm_include_dir, |
| 26 | include_directories('.') |
| 27 | ], |
| 28 | version: meson.project_version(), |
| 29 | gnu_symbol_visibility: 'hidden', |
| 30 | install: true |
| 31 | ) |
| 32 | |
| 33 | libpldm_dep = declare_dependency( |
| 34 | include_directories: libpldm_include_dir, |
| 35 | link_with: libpldm) |
| 36 | |
| 37 | import('pkgconfig').generate( |
| 38 | name: 'libpldm', |
| 39 | description: 'PLDM protocol encode/decode C lib', |
| 40 | version: meson.project_version(), |
| 41 | libraries: libpldm) |
Andrew Jeffery | 5664cf2 | 2023-11-08 15:58:50 +1030 | [diff] [blame] | 42 | |
| 43 | if get_option('tests').allowed() |
| 44 | c_suite = meson.get_compiler('c').get_id() |
| 45 | cpp_suite = meson.get_compiler('cpp').get_id() |
| 46 | |
| 47 | if get_option('abi-compliance-check').allowed() and c_suite == cpp_suite and c_suite == 'gcc' |
| 48 | host = host_machine.cpu_family() |
| 49 | baseline_dump = meson.project_source_root() / 'abi' / host / '@0@.dump'.format(c_suite) |
| 50 | |
| 51 | abi_dumper = find_program('abi-dumper', |
| 52 | native: true, |
| 53 | required: get_option('abi-compliance-check')) |
| 54 | abi_compliance_checker = find_program('abi-compliance-checker', |
| 55 | native: true, |
| 56 | required: get_option('abi-compliance-check')) |
| 57 | |
| 58 | test_abi_compliance = abi_dumper.found() and \ |
| 59 | abi_compliance_checker.found() and \ |
| 60 | import('fs').is_file(baseline_dump) |
| 61 | |
| 62 | if test_abi_compliance |
| 63 | current_dump = custom_target('abi-dump', |
| 64 | input: libpldm, |
| 65 | output: 'current.dump', |
| 66 | command: [ abi_dumper, |
Andrew Jeffery | 1077d2d | 2023-11-28 10:15:36 +1030 | [diff] [blame] | 67 | '-mixed-headers', |
| 68 | '-include-paths', |
| 69 | meson.project_source_root() / 'src', |
Andrew Jeffery | 5664cf2 | 2023-11-08 15:58:50 +1030 | [diff] [blame] | 70 | '-public-headers', |
| 71 | meson.project_source_root() / 'include', |
Andrew Jeffery | 75eea49 | 2023-11-28 10:12:08 +1030 | [diff] [blame] | 72 | '-sort', |
Andrew Jeffery | 5664cf2 | 2023-11-08 15:58:50 +1030 | [diff] [blame] | 73 | '@INPUT@', |
| 74 | '-o', |
| 75 | '@OUTPUT@', |
| 76 | '-lver', |
| 77 | meson.project_version()]) |
| 78 | abi_compliance = custom_target('abi-compliance', |
| 79 | input: [baseline_dump, current_dump], |
| 80 | output: 'abi-compliance', |
| 81 | command: [ abi_compliance_checker, |
| 82 | '-l', |
| 83 | meson.project_name(), |
| 84 | '-old', |
| 85 | '@INPUT0@', |
| 86 | '-new', |
| 87 | '@INPUT1@' ], |
| 88 | build_by_default: true) |
| 89 | endif |
| 90 | endif |
| 91 | endif |