blob: 99e79a26ea84d8b316ef5c3e797a4163ecce33d9 [file] [log] [blame]
Pavithra Barithayaa7989cd2023-10-30 08:52:28 -05001libpldm_sources = files(
Andrew Jeffery9c766792022-08-10 23:12:49 +09302 'base.c',
3 'bios.c',
4 'platform.c',
5 'bios_table.c',
6 'firmware_update.c',
7 'fru.c',
8 'pdr.c',
Andrew Jefferycc45aed2023-09-10 23:03:29 +09309 'responder.c',
Andrew Jeffery9c766792022-08-10 23:12:49 +093010 'utils.c'
11 )
12
Andrew Jeffery55e5e0a2023-06-05 12:33:16 +093013subdir('requester')
14subdir('transport')
15
Andrew Jeffery8de8e1e2023-06-09 14:37:18 +093016if get_option('oem-ibm').allowed()
Andrew Jeffery9c766792022-08-10 23:12:49 +093017 subdir('oem/ibm')
18endif
Pavithra Barithayaa7989cd2023-10-30 08:52:28 -050019
20libpldm = 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
33libpldm_dep = declare_dependency(
34 include_directories: libpldm_include_dir,
35 link_with: libpldm)
36
37import('pkgconfig').generate(
38 name: 'libpldm',
39 description: 'PLDM protocol encode/decode C lib',
40 version: meson.project_version(),
41 libraries: libpldm)
Andrew Jeffery5664cf22023-11-08 15:58:50 +103042
43if 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,
Andrew Jeffery1077d2d2023-11-28 10:15:36 +103067 '-mixed-headers',
68 '-include-paths',
69 meson.project_source_root() / 'src',
Andrew Jeffery5664cf22023-11-08 15:58:50 +103070 '-public-headers',
71 meson.project_source_root() / 'include',
Andrew Jeffery75eea492023-11-28 10:12:08 +103072 '-sort',
Andrew Jeffery5664cf22023-11-08 15:58:50 +103073 '@INPUT@',
74 '-o',
75 '@OUTPUT@',
76 '-lver',
77 meson.project_version()])
78 abi_compliance = custom_target('abi-compliance',
79 input: [baseline_dump, current_dump],
80 output: 'abi-compliance',
81 command: [ abi_compliance_checker,
82 '-l',
83 meson.project_name(),
84 '-old',
85 '@INPUT0@',
86 '-new',
87 '@INPUT1@' ],
88 build_by_default: true)
89 endif
90 endif
91endif