blob: 2e4240e64b30cb6403b6a4e7f05ee7a4ca7c8abd [file] [log] [blame]
Patrick Williamsf254b062023-03-30 15:51:12 -05001project(
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
13cpp = meson.get_compiler('cpp')
14add_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
26if cpp.has_header('nlohmann/json.hpp')
27 nlohmann_json_dep = declare_dependency()
28else
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 )
36endif
37
38boost_dep = dependency(
39 'boost',
40 modules: ['coroutine'],
41 include_type: 'system',
42)
43i2c_dep = cpp.find_library('i2c')
44phosphor_logging_dep = dependency('phosphor-logging')
45sdbusplus_dep = dependency('sdbusplus')
46systemd_dep = dependency('systemd')
47
48executable(
Jorge Cisneros315002a2023-04-07 11:43:45 -050049 'ipmbbridged',
Patrick Williamsf254b062023-03-30 15:51:12 -050050 '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
62install_data(
63 'ipmb.service',
64 install_dir: systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir'),
65)
66
67install_data(
68 'ipmb-channels.json',
69 install_dir: get_option('datadir') / 'ipmbbridge',
70)