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 | |
Delphine CC Chiu | 22fad39 | 2023-10-27 11:05:01 +0800 | [diff] [blame] | 20 | if get_option('oem-meta').allowed() |
| 21 | subdir('oem/meta') |
| 22 | endif |
| 23 | |
Pavithra Barithaya | a7989cd | 2023-10-30 08:52:28 -0500 | [diff] [blame] | 24 | libpldm = library( |
| 25 | 'pldm', |
| 26 | libpldm_sources, |
| 27 | implicit_include_directories: false, |
| 28 | include_directories: [ |
| 29 | libpldm_include_dir, |
| 30 | include_directories('.') |
| 31 | ], |
| 32 | version: meson.project_version(), |
| 33 | gnu_symbol_visibility: 'hidden', |
| 34 | install: true |
| 35 | ) |
| 36 | |
| 37 | libpldm_dep = declare_dependency( |
| 38 | include_directories: libpldm_include_dir, |
| 39 | link_with: libpldm) |
| 40 | |
| 41 | import('pkgconfig').generate( |
| 42 | name: 'libpldm', |
| 43 | description: 'PLDM protocol encode/decode C lib', |
| 44 | version: meson.project_version(), |
| 45 | libraries: libpldm) |
Andrew Jeffery | 5664cf2 | 2023-11-08 15:58:50 +1030 | [diff] [blame] | 46 | |
| 47 | if get_option('tests').allowed() |
| 48 | c_suite = meson.get_compiler('c').get_id() |
| 49 | cpp_suite = meson.get_compiler('cpp').get_id() |
| 50 | |
| 51 | if get_option('abi-compliance-check').allowed() and c_suite == cpp_suite and c_suite == 'gcc' |
| 52 | host = host_machine.cpu_family() |
| 53 | baseline_dump = meson.project_source_root() / 'abi' / host / '@0@.dump'.format(c_suite) |
| 54 | |
| 55 | abi_dumper = find_program('abi-dumper', |
| 56 | native: true, |
| 57 | required: get_option('abi-compliance-check')) |
| 58 | abi_compliance_checker = find_program('abi-compliance-checker', |
| 59 | native: true, |
| 60 | required: get_option('abi-compliance-check')) |
| 61 | |
| 62 | test_abi_compliance = abi_dumper.found() and \ |
| 63 | abi_compliance_checker.found() and \ |
| 64 | import('fs').is_file(baseline_dump) |
| 65 | |
| 66 | if test_abi_compliance |
| 67 | current_dump = custom_target('abi-dump', |
| 68 | input: libpldm, |
| 69 | output: 'current.dump', |
| 70 | command: [ abi_dumper, |
Andrew Jeffery | 1077d2d | 2023-11-28 10:15:36 +1030 | [diff] [blame] | 71 | '-mixed-headers', |
| 72 | '-include-paths', |
| 73 | meson.project_source_root() / 'src', |
Andrew Jeffery | 5664cf2 | 2023-11-08 15:58:50 +1030 | [diff] [blame] | 74 | '-public-headers', |
| 75 | meson.project_source_root() / 'include', |
Andrew Jeffery | 75eea49 | 2023-11-28 10:12:08 +1030 | [diff] [blame] | 76 | '-sort', |
Andrew Jeffery | 5664cf2 | 2023-11-08 15:58:50 +1030 | [diff] [blame] | 77 | '@INPUT@', |
| 78 | '-o', |
| 79 | '@OUTPUT@', |
| 80 | '-lver', |
| 81 | meson.project_version()]) |
| 82 | abi_compliance = custom_target('abi-compliance', |
| 83 | input: [baseline_dump, current_dump], |
| 84 | output: 'abi-compliance', |
| 85 | command: [ abi_compliance_checker, |
| 86 | '-l', |
| 87 | meson.project_name(), |
| 88 | '-old', |
| 89 | '@INPUT0@', |
| 90 | '-new', |
| 91 | '@INPUT1@' ], |
| 92 | build_by_default: true) |
| 93 | endif |
| 94 | endif |
| 95 | endif |