xref: /openbmc/fb-ipmi-oem/meson.build (revision 4ec80567)
1project(
2  'fb-ipmi-oem',
3  'cpp',
4  version: '0.1',
5  meson_version: '>=0.57.0',
6  default_options: [
7    'werror=true',
8    'warning_level=3',
9    'cpp_std=c++20',
10  ])
11
12# Project Arguments
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    '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
23    '-Wno-psabi',
24    '-Wno-pedantic',
25  ]),
26  language : 'cpp')
27
28host_instances = '0'
29if get_option('host-instances') != ''
30  host_instances = get_option('host-instances')
31endif
32
33conf_data = configuration_data()
34conf_data.set_quoted('INSTANCES',host_instances)
35
36configure_file(input: 'meson_config.h.in',
37               output: 'config.h',
38               configuration: conf_data)
39
40if not get_option('bic').disabled()
41  add_project_arguments(
42    cpp.get_supported_arguments([
43        '-DBIC_ENABLED',
44    ]),
45    language : 'cpp')
46endif
47
48root_inc = include_directories('.', 'include')
49
50# Dependencies
51phosphor_logging_dep = dependency('phosphor-logging')
52sdbusplus_dep = dependency('sdbusplus', required : false, include_type: 'system')
53ipmid_dep = dependency('libipmid')
54channellayer_dep = cpp.find_library('channellayer', required: true)
55userlayer_dep = cpp.find_library('userlayer', required: true)
56
57zfboemcmds_pre = declare_dependency(
58  include_directories: root_inc,
59  dependencies: [
60    phosphor_logging_dep,
61    sdbusplus_dep,
62    ipmid_dep,
63    channellayer_dep,
64    userlayer_dep,
65  ])
66
67zfboemcmds_lib = library(
68  'zfboemcmds',
69  'src/oemcommands.cpp',
70  'src/appcommands.cpp',
71  'src/storagecommands.cpp',
72  'src/usb-dbg.cpp',
73  'src/selcommands.cpp',
74  'src/transportcommands.cpp',
75  'src/biccommands.cpp',
76  implicit_include_directories: false,
77  dependencies: zfboemcmds_pre,
78  version: meson.project_version(),
79  override_options: ['b_lundef=false'],
80  install: true,
81  install_dir: get_option('libdir') / 'ipmid-providers')
82
83if get_option('machine') != ''
84  configfile = [
85        'cri_sensors.json',
86        'gpio_desc.json',
87        'post_desc.json'
88   ]
89   foreach c : configfile
90      file = join_paths(get_option('machine'), c)
91      install_data(
92         sources : file,
93         install_dir : get_option('datadir') / 'lcd-debug' )
94   endforeach
95endif
96