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