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, |
| 67 | '-public-headers', |
| 68 | meson.project_source_root() / 'include', |
| 69 | '@INPUT@', |
| 70 | '-o', |
| 71 | '@OUTPUT@', |
| 72 | '-lver', |
| 73 | meson.project_version()]) |
| 74 | abi_compliance = custom_target('abi-compliance', |
| 75 | input: [baseline_dump, current_dump], |
| 76 | output: 'abi-compliance', |
| 77 | command: [ abi_compliance_checker, |
| 78 | '-l', |
| 79 | meson.project_name(), |
| 80 | '-old', |
| 81 | '@INPUT0@', |
| 82 | '-new', |
| 83 | '@INPUT1@' ], |
| 84 | build_by_default: true) |
| 85 | endif |
| 86 | endif |
| 87 | endif |