Patrick Williams | f254b06 | 2023-03-30 15:51:12 -0500 | [diff] [blame] | 1 | project( |
| 2 | 'ipmbbridge', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
| 5 | meson_version: '>=0.57.0', |
| 6 | default_options: [ |
| 7 | 'warning_level=3', |
| 8 | 'werror=true', |
| 9 | 'cpp_std=c++20', |
| 10 | ], |
| 11 | ) |
| 12 | |
| 13 | cpp = meson.get_compiler('cpp') |
| 14 | add_project_arguments( |
| 15 | cpp.get_supported_arguments([ |
| 16 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 17 | '-DBOOST_SYSTEM_NO_DEPRECATED', |
| 18 | '-DBOOST_ALL_NO_LIB', |
| 19 | '-DBOOST_NO_RTTI', |
| 20 | '-DBOOST_NO_TYPEID', |
| 21 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 22 | ]), |
| 23 | language: 'cpp', |
| 24 | ) |
| 25 | |
| 26 | if cpp.has_header('nlohmann/json.hpp') |
| 27 | nlohmann_json_dep = declare_dependency() |
| 28 | else |
| 29 | subproject('nlohmann-json') |
| 30 | nlohmann_json_dep = declare_dependency( |
| 31 | include_directories: include_directories( |
| 32 | 'subprojects/nlohmann-json/single_include', |
| 33 | 'subprojects/nlohmann-json/single_include/nlohmann', |
| 34 | ) |
| 35 | ) |
| 36 | endif |
| 37 | |
| 38 | boost_dep = dependency( |
| 39 | 'boost', |
| 40 | modules: ['coroutine'], |
| 41 | include_type: 'system', |
| 42 | ) |
| 43 | i2c_dep = cpp.find_library('i2c') |
| 44 | phosphor_logging_dep = dependency('phosphor-logging') |
| 45 | sdbusplus_dep = dependency('sdbusplus') |
| 46 | systemd_dep = dependency('systemd') |
| 47 | |
| 48 | executable( |
Jorge Cisneros | 315002a | 2023-04-07 11:43:45 -0500 | [diff] [blame^] | 49 | 'ipmbbridged', |
Patrick Williams | f254b06 | 2023-03-30 15:51:12 -0500 | [diff] [blame] | 50 | 'ipmbbridged.cpp', |
| 51 | 'ipmbutils.cpp', |
| 52 | dependencies: [ |
| 53 | boost_dep, |
| 54 | i2c_dep, |
| 55 | nlohmann_json_dep, |
| 56 | phosphor_logging_dep, |
| 57 | sdbusplus_dep, |
| 58 | ], |
| 59 | install: true, |
| 60 | ) |
| 61 | |
| 62 | install_data( |
| 63 | 'ipmb.service', |
| 64 | install_dir: systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir'), |
| 65 | ) |
| 66 | |
| 67 | install_data( |
| 68 | 'ipmb-channels.json', |
| 69 | install_dir: get_option('datadir') / 'ipmbbridge', |
| 70 | ) |