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