William A. Kennington III | d963adb | 2021-06-15 18:24:00 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-ipmi-blobs', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
Patrick Williams | fda4178 | 2021-10-06 15:37:48 -0500 | [diff] [blame] | 5 | meson_version: '>=0.57.0', |
William A. Kennington III | d963adb | 2021-06-15 18:24:00 -0700 | [diff] [blame] | 6 | default_options: [ |
Patrick Williams | fda4178 | 2021-10-06 15:37:48 -0500 | [diff] [blame] | 7 | 'cpp_std=c++20', |
William A. Kennington III | d963adb | 2021-06-15 18:24:00 -0700 | [diff] [blame] | 8 | 'warning_level=3', |
| 9 | 'werror=true', |
| 10 | ]) |
| 11 | |
| 12 | ipmi_blob_dep = declare_dependency( |
| 13 | include_directories: include_directories('.')) |
| 14 | |
William A. Kennington III | d5ed409 | 2021-06-16 12:31:07 -0700 | [diff] [blame] | 15 | install_headers( |
| 16 | 'blobs-ipmid/blobs.hpp', |
| 17 | subdir: 'blobs-ipmid') |
| 18 | |
William A. Kennington III | d963adb | 2021-06-15 18:24:00 -0700 | [diff] [blame] | 19 | import('pkgconfig').generate( |
| 20 | name: 'phosphor-ipmi-blobs', |
| 21 | description: 'Phosphor Blob Transfer Interface', |
| 22 | version: meson.project_version()) |
| 23 | |
Willy Tu | 88ca532 | 2022-06-14 01:18:53 -0700 | [diff] [blame^] | 24 | cpp = meson.get_compiler('cpp') |
| 25 | |
William A. Kennington III | d963adb | 2021-06-15 18:24:00 -0700 | [diff] [blame] | 26 | phosphor_logging_dep = dependency('phosphor-logging') |
Willy Tu | 88ca532 | 2022-06-14 01:18:53 -0700 | [diff] [blame^] | 27 | ipmid_dep = dependency('libipmid') |
| 28 | channellayer_dep = cpp.find_library('channellayer', required: true) |
William A. Kennington III | d963adb | 2021-06-15 18:24:00 -0700 | [diff] [blame] | 29 | |
| 30 | blob_manager_pre = declare_dependency( |
| 31 | dependencies: [ |
| 32 | ipmi_blob_dep, |
| 33 | dependency('ipmiblob'), |
| 34 | phosphor_logging_dep, |
| 35 | ]) |
| 36 | |
| 37 | blob_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 | |
| 48 | blob_manager_dep = declare_dependency( |
| 49 | link_with: blob_manager_lib, |
| 50 | dependencies: blob_manager_pre) |
| 51 | |
| 52 | conf_data = configuration_data() |
| 53 | conf_data.set_quoted( |
| 54 | 'BLOB_LIB_PATH', |
| 55 | get_option('prefix') / get_option('libdir') / 'blob-ipmid') |
| 56 | conf_h = configure_file( |
| 57 | output: 'config.h', |
| 58 | configuration: conf_data) |
| 59 | |
| 60 | shared_module( |
| 61 | 'blobmanager', |
| 62 | conf_h, |
| 63 | 'main.cpp', |
| 64 | implicit_include_directories: false, |
| 65 | dependencies: [ |
| 66 | blob_manager_dep, |
Willy Tu | 88ca532 | 2022-06-14 01:18:53 -0700 | [diff] [blame^] | 67 | ipmid_dep, |
| 68 | channellayer_dep, |
William A. Kennington III | d963adb | 2021-06-15 18:24:00 -0700 | [diff] [blame] | 69 | ], |
| 70 | install: true, |
| 71 | install_dir: get_option('libdir') / 'ipmid-providers') |
| 72 | |
| 73 | if get_option('examples') |
| 74 | subdir('example') |
| 75 | endif |
| 76 | |
| 77 | if not get_option('tests').disabled() |
| 78 | subdir('test') |
| 79 | endif |