Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 1 | project( |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 2 | '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 Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 8 | |
| 9 | # Project Arguments |
| 10 | all_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. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 22 | ] |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 23 | |
| 24 | feature_map = { |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 25 | 'intel-pfr': '-DINTEL_PFR_ENABLED', |
| 26 | 'bmc-validation-unsecure-feature': '-DBMC_VALIDATION_UNSECURE_FEATURE', |
| 27 | 'using-entity-manager-decorators': '-DUSING_ENTITY_MANAGER_DECORATORS', |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | foreach option_key, option_value : feature_map |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 31 | 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 Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 35 | endforeach |
| 36 | |
| 37 | cpp = meson.get_compiler('cpp') |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 38 | add_project_arguments(cpp.get_supported_arguments(all_args), language: 'cpp') |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 39 | |
| 40 | fs = import('fs') |
| 41 | |
| 42 | root_inc = include_directories('.', 'include') |
| 43 | |
| 44 | # Dependencies |
Patrick Williams | 77a4429 | 2023-12-07 17:18:26 -0600 | [diff] [blame] | 45 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 46 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 47 | phosphor_logging_dep = dependency('phosphor-logging') |
Patrick Williams | 77a4429 | 2023-12-07 17:18:26 -0600 | [diff] [blame] | 48 | sdbusplus_dep = dependency('sdbusplus') |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 49 | ipmid_dep = dependency('libipmid') |
| 50 | channellayer_dep = dependency('libchannellayer') |
| 51 | userlayer_dep = dependency('libuserlayer') |
| 52 | |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 53 | |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 54 | tinyxml_dep = dependency( |
| 55 | 'tinyxml2', |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 56 | default_options: ['tests=false'], |
| 57 | include_type: 'system', |
| 58 | ) |
| 59 | |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 60 | gpio_dep = dependency('libgpiodcxx', default_options: ['bindings=cxx']) |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 61 | |
| 62 | zinteloemcmds_pre = declare_dependency( |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 63 | 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 Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 76 | |
| 77 | prog_python = import('python').find_installation('python3') |
| 78 | generate_allowlist_script = files('generate-allowlist.py') |
| 79 | ipmiallowlist = custom_target( |
| 80 | 'ipmi-allowlist.hpp', |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 81 | input: [generate_allowlist_script, 'ipmi-allowlist.conf'], |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 82 | output: 'ipmi-allowlist.hpp', |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 83 | command: [prog_python, '@INPUT0@', '@INPUT1@', '@OUTPUT@'], |
| 84 | ) |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 85 | |
| 86 | zinteloemcmds_src = [ |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 87 | '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 Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 104 | ] |
| 105 | |
| 106 | zinteloemcmds_lib = library( |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 107 | '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 Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 116 | |
| 117 | if get_option('tests').allowed() |
Jason M. Bills | 97d1fb3 | 2025-04-23 08:57:35 -0700 | [diff] [blame] | 118 | subdir('tests') |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 119 | endif |