1project(
2  'phosphor-ipmi-blobs',
3  'cpp',
4  version: '0.1',
5  meson_version: '>=1.1.1',
6  default_options: [
7    'cpp_std=c++23',
8    'warning_level=3',
9    'werror=true',
10  ])
11
12ipmi_blob_dep = declare_dependency(
13  include_directories: include_directories('.'))
14
15install_headers(
16  'blobs-ipmid/blobs.hpp',
17  subdir: 'blobs-ipmid')
18
19import('pkgconfig').generate(
20  name: 'phosphor-ipmi-blobs',
21  description: 'Phosphor Blob Transfer Interface',
22  version: meson.project_version())
23
24cpp = meson.get_compiler('cpp')
25
26phosphor_logging_dep = dependency('phosphor-logging')
27ipmid_dep = dependency('libipmid')
28channellayer_dep = cpp.find_library('channellayer', required: true)
29
30blob_manager_pre = declare_dependency(
31  dependencies: [
32    ipmi_blob_dep,
33    dependency('ipmiblob'),
34    phosphor_logging_dep,
35  ])
36
37blob_manager_lib = static_library(
38  'blobmanager',
39  'fs.cpp',
40  'internal/sys.cpp',
41  'ipmi.cpp',
42  'manager.cpp',
43  'process.cpp',
44  'utils.cpp',
45  implicit_include_directories: false,
46  dependencies: blob_manager_pre)
47
48blob_manager_dep = declare_dependency(
49  link_with: blob_manager_lib,
50  dependencies: blob_manager_pre)
51
52conf_data = configuration_data()
53conf_data.set_quoted(
54  'BLOB_LIB_PATH',
55  get_option('prefix') / get_option('libdir') / 'blob-ipmid')
56conf_h = configure_file(
57  output: 'config.h',
58  configuration: conf_data)
59
60shared_module(
61  'blobmanager',
62  conf_h,
63  'main.cpp',
64  implicit_include_directories: false,
65  dependencies: [
66    blob_manager_dep,
67    ipmid_dep,
68    channellayer_dep,
69  ],
70  install: true,
71  install_dir: get_option('libdir') / 'ipmid-providers')
72
73if get_option('examples')
74  subdir('example')
75endif
76
77if not get_option('tests').disabled()
78  subdir('test')
79endif
80