Jie Yang | b988dbb | 2021-08-06 18:34:49 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-ipmi-blobs-binarystore', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
| 5 | meson_version: '>=0.57.0', |
| 6 | default_options: [ |
| 7 | 'cpp_std=c++20', |
| 8 | 'warning_level=3', |
| 9 | 'werror=true', |
| 10 | ] |
| 11 | ) |
| 12 | |
| 13 | |
| 14 | cpp = meson.get_compiler('cpp') |
| 15 | cpp.has_header('boost/endian/arithmetic.hpp') |
| 16 | cpp.has_header('nlohmann/json.hpp') |
| 17 | protobuf_dep = dependency('protobuf') |
| 18 | ipmi_blob_dep = dependency('phosphor-ipmi-blobs') |
| 19 | phosphor_logging_dep = dependency('phosphor-logging') |
| 20 | |
| 21 | subdir('proto') |
| 22 | |
| 23 | binarystoreblob_pre = declare_dependency( |
| 24 | include_directories: [ |
| 25 | include_directories('.'), |
| 26 | include_directories('proto')], |
| 27 | dependencies: [ |
| 28 | protobuf_dep, |
| 29 | ipmi_blob_dep, |
| 30 | phosphor_logging_dep, |
| 31 | ]) |
| 32 | |
| 33 | binarystoreblob_lib = library( |
| 34 | 'binarystore', |
| 35 | 'binarystore.cpp', |
| 36 | 'sys.cpp', |
| 37 | 'sys_file_impl.cpp', |
| 38 | 'handler.cpp', |
| 39 | proto, |
| 40 | implicit_include_directories: false, |
| 41 | dependencies: binarystoreblob_pre, |
| 42 | install: true, |
| 43 | install_dir: get_option('libdir') / 'blob-ipmid') |
| 44 | |
| 45 | binarystoreblob_dep = declare_dependency( |
| 46 | link_with: binarystoreblob_lib, |
| 47 | dependencies: binarystoreblob_pre) |
| 48 | |
| 49 | if not get_option('blobtool').disabled() |
| 50 | executable( |
| 51 | 'blobtool', |
| 52 | 'blobtool.cpp', |
| 53 | implicit_include_directories: false, |
| 54 | dependencies: binarystoreblob_dep, |
| 55 | install: true) |
| 56 | endif |
| 57 | |
| 58 | |
| 59 | if not get_option('tests').disabled() |
| 60 | subdir('test') |
| 61 | endif |