blob: 525463fcd0d17f9f6bb9d24511ae5fb6be002695 [file] [log] [blame]
Pavithra Barithayaa7989cd2023-10-30 08:52:28 -05001libpldm_sources = files(
Andrew Jefferycc45aed2023-09-10 23:03:29 +09302 'responder.c',
Andrew Jeffery9c766792022-08-10 23:12:49 +09303 'utils.c'
Andrew Jeffery48761c62024-06-03 15:48:26 +09304)
Andrew Jeffery9c766792022-08-10 23:12:49 +09305
Andrew Jeffery48761c62024-06-03 15:48:26 +09306subdir('dsp')
Andrew Jeffery55e5e0a2023-06-05 12:33:16 +09307subdir('requester')
8subdir('transport')
9
Andrew Jeffery8de8e1e2023-06-09 14:37:18 +093010if get_option('oem-ibm').allowed()
Andrew Jeffery9c766792022-08-10 23:12:49 +093011 subdir('oem/ibm')
12endif
Pavithra Barithayaa7989cd2023-10-30 08:52:28 -050013
Delphine CC Chiu22fad392023-10-27 11:05:01 +080014if get_option('oem-meta').allowed()
15 subdir('oem/meta')
16endif
17
Pavithra Barithayaa7989cd2023-10-30 08:52:28 -050018libpldm = library(
19 'pldm',
20 libpldm_sources,
21 implicit_include_directories: false,
22 include_directories: [
23 libpldm_include_dir,
24 include_directories('.')
25 ],
26 version: meson.project_version(),
27 gnu_symbol_visibility: 'hidden',
28 install: true
29 )
30
31libpldm_dep = declare_dependency(
32 include_directories: libpldm_include_dir,
33 link_with: libpldm)
34
35import('pkgconfig').generate(
36 name: 'libpldm',
37 description: 'PLDM protocol encode/decode C lib',
38 version: meson.project_version(),
39 libraries: libpldm)
Andrew Jeffery5664cf22023-11-08 15:58:50 +103040
41if get_option('tests').allowed()
42 c_suite = meson.get_compiler('c').get_id()
43 cpp_suite = meson.get_compiler('cpp').get_id()
44
45 if get_option('abi-compliance-check').allowed() and c_suite == cpp_suite and c_suite == 'gcc'
46 host = host_machine.cpu_family()
47 baseline_dump = meson.project_source_root() / 'abi' / host / '@0@.dump'.format(c_suite)
48
49 abi_dumper = find_program('abi-dumper',
50 native: true,
51 required: get_option('abi-compliance-check'))
52 abi_compliance_checker = find_program('abi-compliance-checker',
53 native: true,
54 required: get_option('abi-compliance-check'))
55
56 test_abi_compliance = abi_dumper.found() and \
57 abi_compliance_checker.found() and \
58 import('fs').is_file(baseline_dump)
59
60 if test_abi_compliance
61 current_dump = custom_target('abi-dump',
62 input: libpldm,
63 output: 'current.dump',
64 command: [ abi_dumper,
Andrew Jeffery1077d2d2023-11-28 10:15:36 +103065 '-mixed-headers',
66 '-include-paths',
67 meson.project_source_root() / 'src',
Andrew Jeffery5664cf22023-11-08 15:58:50 +103068 '-public-headers',
69 meson.project_source_root() / 'include',
Andrew Jeffery75eea492023-11-28 10:12:08 +103070 '-sort',
Andrew Jeffery5664cf22023-11-08 15:58:50 +103071 '@INPUT@',
72 '-o',
73 '@OUTPUT@',
74 '-lver',
75 meson.project_version()])
76 abi_compliance = custom_target('abi-compliance',
77 input: [baseline_dump, current_dump],
78 output: 'abi-compliance',
79 command: [ abi_compliance_checker,
80 '-l',
81 meson.project_name(),
82 '-old',
83 '@INPUT0@',
84 '-new',
85 '@INPUT1@' ],
86 build_by_default: true)
87 endif
88 endif
89endif