xref: /openbmc/intel-ipmi-oem/meson.build (revision 77a44298a726b20e595ee596ce0018e00493ef7e)
1project(
2  'intel-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
13all_args = [
14    '-DBOOST_ERROR_CODE_HEADER_ONLY',
15    '-DBOOST_SYSTEM_NO_DEPRECATED',
16    '-DBOOST_ALL_NO_LIB',
17    '-DBOOST_NO_RTTI',
18    '-DBOOST_NO_TYPEID',
19    '-DBOOST_ASIO_DISABLE_THREADS',
20    '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
21    '-DBMC_VALIDATION_UNSECURE_FEATURE',
22    '-DUSING_ENTITY_MANAGER_DECORATORS',
23    '-Wno-psabi',
24    '-Wno-pedantic',
25  ]
26
27feature_map = {
28  'intel-pfr': '-DINTEL_PFR_ENABLED',
29  'bmc-validation-unsecure-feature': '-DBMC_VALIDATION_UNSECURE_FEATURE',
30  'using-entity-manager-decorators': '-DUSING_ENTITY_MANAGER_DECORATORS',
31}
32
33foreach option_key, option_value : feature_map
34  if(get_option(option_key).allowed())
35    summary(option_key,option_value, section : 'Enabled Features')
36    add_project_arguments(option_value,language:'cpp')
37  endif
38endforeach
39
40cpp = meson.get_compiler('cpp')
41add_project_arguments(
42  cpp.get_supported_arguments(all_args),
43  language : 'cpp')
44
45fs = import('fs')
46
47root_inc = include_directories('.', 'include')
48
49# Dependencies
50nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
51phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
52phosphor_logging_dep = dependency('phosphor-logging')
53sdbusplus_dep = dependency('sdbusplus')
54ipmid_dep = dependency('libipmid')
55channellayer_dep = dependency('libchannellayer')
56userlayer_dep = dependency('libuserlayer')
57
58
59tinyxml_dep = dependency('tinyxml2',
60    default_options: ['tests=false'],
61    include_type: 'system',
62)
63
64gpio_dep = dependency('libgpiodcxx',
65      default_options: ['bindings=cxx'],
66      )
67
68zinteloemcmds_pre = declare_dependency(
69  include_directories: root_inc,
70  dependencies: [
71    channellayer_dep,
72    ipmid_dep,
73    gpio_dep,
74    nlohmann_json_dep,
75    phosphor_dbus_interfaces_dep,
76    phosphor_logging_dep,
77    sdbusplus_dep,
78    tinyxml_dep,
79    userlayer_dep,
80  ])
81
82prog_python = import('python').find_installation('python3')
83generate_allowlist_script = files('generate-allowlist.py')
84ipmiallowlist = custom_target(
85    'ipmi-allowlist.hpp',
86    input: [generate_allowlist_script, 'ipmi-allowlist.conf' ],
87    output: 'ipmi-allowlist.hpp',
88    command: [ prog_python, '@INPUT0@', '@INPUT1@', '@OUTPUT@' ],
89    )
90
91zinteloemcmds_src = [
92  'src/oemcommands.cpp',
93  'src/sensorcommands.cpp',
94  'src/biosconfigcommands.cpp',
95  'src/storagecommands.cpp',
96  'src/multinodecommands.cpp',
97  'src/firmware-update.cpp',
98  'src/appcommands.cpp',
99  'src/smbiosmdrv2handler.cpp',
100  'src/manufacturingcommands.cpp',
101  'src/bmccontrolservices.cpp',
102  'src/bridgingcommands.cpp',
103  'src/ipmi_to_redfish_hooks.cpp',
104  'src/me_to_redfish_hooks.cpp',
105  'src/chassiscommands.cpp',
106  'src/allowlist-filter.cpp',
107  'src/fruutils.cpp',
108  ipmiallowlist,
109]
110
111zinteloemcmds_lib = library(
112  'zinteloemcmds',
113  sources: zinteloemcmds_src,
114  implicit_include_directories: false,
115  dependencies: zinteloemcmds_pre,
116  version: meson.project_version(),
117  override_options: ['b_lundef=false'],
118  install: true,
119  install_dir: get_option('libdir') / 'ipmid-providers')
120
121if get_option('tests').allowed()
122  subdir('tests')
123endif
124