blob: eb1de6c7d6f897d4dca4f1fe7ebe8231cdea370b [file] [log] [blame]
Vernon Mauery4a316052022-09-26 13:43:17 -07001project(
Jason M. Bills97d1fb32025-04-23 08:57:35 -07002 'intel-ipmi-oem',
3 'cpp',
4 version: '0.1',
5 meson_version: '>=1.1.1',
6 default_options: ['werror=true', 'warning_level=3', 'cpp_std=c++23'],
7)
Vernon Mauery4a316052022-09-26 13:43:17 -07008
9# Project Arguments
10all_args = [
11 '-DBOOST_ERROR_CODE_HEADER_ONLY',
12 '-DBOOST_SYSTEM_NO_DEPRECATED',
13 '-DBOOST_ALL_NO_LIB',
14 '-DBOOST_NO_RTTI',
15 '-DBOOST_NO_TYPEID',
16 '-DBOOST_ASIO_DISABLE_THREADS',
17 '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
18 '-DBMC_VALIDATION_UNSECURE_FEATURE',
19 '-DUSING_ENTITY_MANAGER_DECORATORS',
20 '-Wno-psabi',
21 '-Wno-pedantic',
Jason M. Bills97d1fb32025-04-23 08:57:35 -070022]
Vernon Mauery4a316052022-09-26 13:43:17 -070023
24feature_map = {
Jason M. Bills97d1fb32025-04-23 08:57:35 -070025 'intel-pfr': '-DINTEL_PFR_ENABLED',
26 'bmc-validation-unsecure-feature': '-DBMC_VALIDATION_UNSECURE_FEATURE',
27 'using-entity-manager-decorators': '-DUSING_ENTITY_MANAGER_DECORATORS',
Vernon Mauery4a316052022-09-26 13:43:17 -070028}
29
30foreach option_key, option_value : feature_map
Jason M. Bills97d1fb32025-04-23 08:57:35 -070031 if (get_option(option_key).allowed())
32 summary(option_key, option_value, section: 'Enabled Features')
33 add_project_arguments(option_value, language: 'cpp')
34 endif
Vernon Mauery4a316052022-09-26 13:43:17 -070035endforeach
36
37cpp = meson.get_compiler('cpp')
Jason M. Bills97d1fb32025-04-23 08:57:35 -070038add_project_arguments(cpp.get_supported_arguments(all_args), language: 'cpp')
Vernon Mauery4a316052022-09-26 13:43:17 -070039
40fs = import('fs')
41
42root_inc = include_directories('.', 'include')
43
44# Dependencies
Patrick Williams77a44292023-12-07 17:18:26 -060045nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
Vernon Mauery4a316052022-09-26 13:43:17 -070046phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
47phosphor_logging_dep = dependency('phosphor-logging')
Patrick Williams77a44292023-12-07 17:18:26 -060048sdbusplus_dep = dependency('sdbusplus')
Vernon Mauery4a316052022-09-26 13:43:17 -070049ipmid_dep = dependency('libipmid')
50channellayer_dep = dependency('libchannellayer')
51userlayer_dep = dependency('libuserlayer')
52
Vernon Mauery4a316052022-09-26 13:43:17 -070053
Jason M. Bills97d1fb32025-04-23 08:57:35 -070054tinyxml_dep = dependency(
55 'tinyxml2',
Vernon Mauery4a316052022-09-26 13:43:17 -070056 default_options: ['tests=false'],
57 include_type: 'system',
58)
59
Jason M. Bills97d1fb32025-04-23 08:57:35 -070060gpio_dep = dependency('libgpiodcxx', default_options: ['bindings=cxx'])
Vernon Mauery4a316052022-09-26 13:43:17 -070061
62zinteloemcmds_pre = declare_dependency(
Jason M. Bills97d1fb32025-04-23 08:57:35 -070063 include_directories: root_inc,
64 dependencies: [
65 channellayer_dep,
66 ipmid_dep,
67 gpio_dep,
68 nlohmann_json_dep,
69 phosphor_dbus_interfaces_dep,
70 phosphor_logging_dep,
71 sdbusplus_dep,
72 tinyxml_dep,
73 userlayer_dep,
74 ],
75)
Vernon Mauery4a316052022-09-26 13:43:17 -070076
77prog_python = import('python').find_installation('python3')
78generate_allowlist_script = files('generate-allowlist.py')
79ipmiallowlist = custom_target(
80 'ipmi-allowlist.hpp',
Jason M. Bills97d1fb32025-04-23 08:57:35 -070081 input: [generate_allowlist_script, 'ipmi-allowlist.conf'],
Vernon Mauery4a316052022-09-26 13:43:17 -070082 output: 'ipmi-allowlist.hpp',
Jason M. Bills97d1fb32025-04-23 08:57:35 -070083 command: [prog_python, '@INPUT0@', '@INPUT1@', '@OUTPUT@'],
84)
Vernon Mauery4a316052022-09-26 13:43:17 -070085
86zinteloemcmds_src = [
Jason M. Bills97d1fb32025-04-23 08:57:35 -070087 'src/oemcommands.cpp',
88 'src/sensorcommands.cpp',
89 'src/biosconfigcommands.cpp',
90 'src/storagecommands.cpp',
91 'src/multinodecommands.cpp',
92 'src/firmware-update.cpp',
93 'src/appcommands.cpp',
94 'src/smbiosmdrv2handler.cpp',
95 'src/manufacturingcommands.cpp',
96 'src/bmccontrolservices.cpp',
97 'src/bridgingcommands.cpp',
98 'src/ipmi_to_redfish_hooks.cpp',
99 'src/me_to_redfish_hooks.cpp',
100 'src/chassiscommands.cpp',
101 'src/allowlist-filter.cpp',
102 'src/fruutils.cpp',
103 ipmiallowlist,
Vernon Mauery4a316052022-09-26 13:43:17 -0700104]
105
106zinteloemcmds_lib = library(
Jason M. Bills97d1fb32025-04-23 08:57:35 -0700107 'zinteloemcmds',
108 sources: zinteloemcmds_src,
109 implicit_include_directories: false,
110 dependencies: zinteloemcmds_pre,
111 version: meson.project_version(),
112 override_options: ['b_lundef=false'],
113 install: true,
114 install_dir: get_option('libdir') / 'ipmid-providers',
115)
Vernon Mauery4a316052022-09-26 13:43:17 -0700116
117if get_option('tests').allowed()
Jason M. Bills97d1fb32025-04-23 08:57:35 -0700118 subdir('tests')
Vernon Mauery4a316052022-09-26 13:43:17 -0700119endif