blob: 911aef01ed31f77f2039cc0a470b5f6bc87ea360 [file] [log] [blame]
Alexander Hansend6a95742025-01-06 15:06:25 +01001libpldmpp_sources = files('firmware_update.cpp', 'types.cpp', 'utils.cpp')
2
3libpldmpp = library(
4 'pldm++',
5 libpldmpp_sources,
6 implicit_include_directories: false,
7 include_directories: [include_root, include_directories('.')],
8 link_args: libpldm_link_args,
9 version: meson.project_version(),
10 dependencies: [libpldm_dep],
11 gnu_symbol_visibility: 'hidden',
12 install: true,
13)
14
15libpldmpp_dep = declare_dependency(
16 include_directories: include_root,
17 link_with: libpldmpp,
18)
19
Alexander Hansen9131a3e2026-02-23 05:19:16 +010020import('pkgconfig').generate(
21 name: 'libpldm++',
22 description: 'An ergonomic C++ interface to PLDM functionality implemented by libpldm',
23 version: meson.project_version(),
24 libraries: libpldmpp,
25 requires: ['libpldm'],
26)
27
Alexander Hansend6a95742025-01-06 15:06:25 +010028c_suite = meson.get_compiler('c').get_id()
29cpp_suite = meson.get_compiler('cpp').get_id()
30
31if get_option('tests') and get_option('abi-compliance-check') and c_suite == cpp_suite and c_suite == 'gcc'
32
33 message('running C++ binding ABI compliance check')
34
35 host = host_machine.cpu_family()
36 baseline_dump_cpp = meson.project_source_root() / 'abi' / host / 'libpldm++/@0@.dump'.format(
37 cpp_suite,
38 )
39
40 current_dump_cpp = custom_target(
41 'abi-dump-cpp',
42 input: libpldmpp,
43 output: 'current.dump',
44 command: [
45 abi_dumper,
46 '-mixed-headers',
47 '-include-paths',
48 meson.project_source_root() / 'bindings/cpp',
49 '-public-headers',
50 meson.project_source_root() / 'include/libpldm++',
51 '-sort',
52 '@INPUT@',
53 '-o',
54 '@OUTPUT@',
55 '-lver',
56 meson.project_version(),
57 ],
58 )
59 abi_compliance_cpp = custom_target(
60 'abi-compliance-cpp',
61 input: [baseline_dump_cpp, current_dump_cpp],
62 output: 'abi-compliance-cpp',
63 command: [
64 abi_compliance_checker,
65 '-l',
66 meson.project_name() + 'plus',
67 '-old',
68 '@INPUT0@',
69 '-new',
70 '@INPUT1@',
71 ],
72 build_by_default: true,
73 )
74endif