blob: 421af50c104de6f3dbb1c327dbc0b213f33a65ec [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,
67 '-public-headers',
68 meson.project_source_root() / 'include',
69 '@INPUT@',
70 '-o',
71 '@OUTPUT@',
72 '-lver',
73 meson.project_version()])
74 abi_compliance = custom_target('abi-compliance',
75 input: [baseline_dump, current_dump],
76 output: 'abi-compliance',
77 command: [ abi_compliance_checker,
78 '-l',
79 meson.project_name(),
80 '-old',
81 '@INPUT0@',
82 '-new',
83 '@INPUT1@' ],
84 build_by_default: true)
85 endif
86 endif
87endif