xref: /openbmc/fb-ipmi-oem/meson.build (revision 7451903c)
1project(
2  'fb-ipmi-oem',
3  'cpp',
4  version: '0.1',
5  meson_version: '>=1.1.1',
6  default_options: [
7    'werror=true',
8    'warning_level=3',
9    'cpp_std=c++23',
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
28fs = import('fs')
29
30host_instances = '0'
31if get_option('host-instances') != ''
32  host_instances = get_option('host-instances')
33endif
34
35conf_data = configuration_data()
36conf_data.set_quoted('INSTANCES',host_instances)
37conf_data.set('POST_CODE_BYTES', get_option('post-code-bytes'))
38
39configure_file(input: 'meson_config.h.in',
40               output: 'config.h',
41               configuration: conf_data)
42
43if not get_option('bic').disabled()
44  add_project_arguments(
45    cpp.get_supported_arguments([
46        '-DBIC_ENABLED',
47    ]),
48    language : 'cpp')
49endif
50
51root_inc = include_directories('.', 'include')
52
53# Dependencies
54sdbusplus_dep = dependency('sdbusplus')
55phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
56phosphor_logging_dep = dependency('phosphor-logging')
57ipmid_dep = dependency('libipmid')
58channellayer_dep = dependency('libchannellayer')
59userlayer_dep = dependency('libuserlayer')
60
61nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
62
63zfboemcmds_pre = declare_dependency(
64  include_directories: root_inc,
65  dependencies: [
66    channellayer_dep,
67    ipmid_dep,
68    nlohmann_json_dep,
69    phosphor_dbus_interfaces_dep,
70    phosphor_logging_dep,
71    sdbusplus_dep,
72    userlayer_dep,
73  ])
74
75zfboemcmds_lib = library(
76  'zfboemcmds',
77  'src/commandutils.cpp',
78  'src/oemcommands.cpp',
79  'src/appcommands.cpp',
80  'src/storagecommands.cpp',
81  'src/usb-dbg.cpp',
82  'src/selcommands.cpp',
83  'src/transportcommands.cpp',
84  'src/biccommands.cpp',
85  implicit_include_directories: false,
86  dependencies: zfboemcmds_pre,
87  version: meson.project_version(),
88  override_options: ['b_lundef=false'],
89  install: true,
90  install_dir: get_option('libdir') / 'ipmid-providers')
91
92if get_option('machine') != ''
93  configfile = [
94        'cri_sensors.json',
95        'gpio_desc.json',
96        'post_desc.json'
97   ]
98   foreach c : configfile
99      file = join_paths('configs', get_option('machine'), c)
100      if not fs.is_file(file)
101         warning('Missing config file: ' + file)
102      else
103          install_data(
104              sources : file,
105              install_dir : get_option('datadir') / 'lcd-debug'
106          )
107      endif
108   endforeach
109endif
110