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