| Alexander Hansen | d6a9574 | 2025-01-06 15:06:25 +0100 | [diff] [blame] | 1 | libpldmpp_sources = files('firmware_update.cpp', 'types.cpp', 'utils.cpp') |
| 2 | |
| 3 | libpldmpp = 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 | |
| 15 | libpldmpp_dep = declare_dependency( |
| 16 | include_directories: include_root, |
| 17 | link_with: libpldmpp, |
| 18 | ) |
| 19 | |
| Alexander Hansen | 9131a3e | 2026-02-23 05:19:16 +0100 | [diff] [blame] | 20 | import('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 Hansen | d6a9574 | 2025-01-06 15:06:25 +0100 | [diff] [blame] | 28 | c_suite = meson.get_compiler('c').get_id() |
| 29 | cpp_suite = meson.get_compiler('cpp').get_id() |
| 30 | |
| 31 | if 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 | ) |
| 74 | endif |