blob: 9f4487c06c36bc854dfb0dde976a5db8acf65bf3 [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
Delphine CC Chiu22fad392023-10-27 11:05:01 +080020if get_option('oem-meta').allowed()
21 subdir('oem/meta')
22endif
23
Pavithra Barithayaa7989cd2023-10-30 08:52:28 -050024libpldm = library(
25 'pldm',
26 libpldm_sources,
27 implicit_include_directories: false,
28 include_directories: [
29 libpldm_include_dir,
30 include_directories('.')
31 ],
32 version: meson.project_version(),
33 gnu_symbol_visibility: 'hidden',
34 install: true
35 )
36
37libpldm_dep = declare_dependency(
38 include_directories: libpldm_include_dir,
39 link_with: libpldm)
40
41import('pkgconfig').generate(
42 name: 'libpldm',
43 description: 'PLDM protocol encode/decode C lib',
44 version: meson.project_version(),
45 libraries: libpldm)
Andrew Jeffery5664cf22023-11-08 15:58:50 +103046
47if get_option('tests').allowed()
48 c_suite = meson.get_compiler('c').get_id()
49 cpp_suite = meson.get_compiler('cpp').get_id()
50
51 if get_option('abi-compliance-check').allowed() and c_suite == cpp_suite and c_suite == 'gcc'
52 host = host_machine.cpu_family()
53 baseline_dump = meson.project_source_root() / 'abi' / host / '@0@.dump'.format(c_suite)
54
55 abi_dumper = find_program('abi-dumper',
56 native: true,
57 required: get_option('abi-compliance-check'))
58 abi_compliance_checker = find_program('abi-compliance-checker',
59 native: true,
60 required: get_option('abi-compliance-check'))
61
62 test_abi_compliance = abi_dumper.found() and \
63 abi_compliance_checker.found() and \
64 import('fs').is_file(baseline_dump)
65
66 if test_abi_compliance
67 current_dump = custom_target('abi-dump',
68 input: libpldm,
69 output: 'current.dump',
70 command: [ abi_dumper,
Andrew Jeffery1077d2d2023-11-28 10:15:36 +103071 '-mixed-headers',
72 '-include-paths',
73 meson.project_source_root() / 'src',
Andrew Jeffery5664cf22023-11-08 15:58:50 +103074 '-public-headers',
75 meson.project_source_root() / 'include',
Andrew Jeffery75eea492023-11-28 10:12:08 +103076 '-sort',
Andrew Jeffery5664cf22023-11-08 15:58:50 +103077 '@INPUT@',
78 '-o',
79 '@OUTPUT@',
80 '-lver',
81 meson.project_version()])
82 abi_compliance = custom_target('abi-compliance',
83 input: [baseline_dump, current_dump],
84 output: 'abi-compliance',
85 command: [ abi_compliance_checker,
86 '-l',
87 meson.project_name(),
88 '-old',
89 '@INPUT0@',
90 '-new',
91 '@INPUT1@' ],
92 build_by_default: true)
93 endif
94 endif
95endif