Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 1 | project( |
| 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 |
| 13 | all_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 | |
| 27 | feature_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 | |
| 33 | foreach 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 |
| 38 | endforeach |
| 39 | |
| 40 | cpp = meson.get_compiler('cpp') |
| 41 | add_project_arguments( |
| 42 | cpp.get_supported_arguments(all_args), |
| 43 | language : 'cpp') |
| 44 | |
| 45 | fs = import('fs') |
| 46 | |
| 47 | root_inc = include_directories('.', 'include') |
| 48 | |
| 49 | # Dependencies |
Patrick Williams | 77a4429 | 2023-12-07 17:18:26 -0600 | [diff] [blame] | 50 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 51 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 52 | phosphor_logging_dep = dependency('phosphor-logging') |
Patrick Williams | 77a4429 | 2023-12-07 17:18:26 -0600 | [diff] [blame] | 53 | sdbusplus_dep = dependency('sdbusplus') |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 54 | ipmid_dep = dependency('libipmid') |
| 55 | channellayer_dep = dependency('libchannellayer') |
| 56 | userlayer_dep = dependency('libuserlayer') |
| 57 | |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 58 | |
| 59 | tinyxml_dep = dependency('tinyxml2', |
| 60 | default_options: ['tests=false'], |
| 61 | include_type: 'system', |
| 62 | ) |
| 63 | |
| 64 | gpio_dep = dependency('libgpiodcxx', |
| 65 | default_options: ['bindings=cxx'], |
| 66 | ) |
| 67 | |
| 68 | zinteloemcmds_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 | |
| 82 | prog_python = import('python').find_installation('python3') |
| 83 | generate_allowlist_script = files('generate-allowlist.py') |
| 84 | ipmiallowlist = 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 | |
| 91 | zinteloemcmds_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', |
Peter Foley | 21a1b5f | 2023-10-31 17:42:04 -0400 | [diff] [blame] | 107 | 'src/fruutils.cpp', |
Vernon Mauery | 4a31605 | 2022-09-26 13:43:17 -0700 | [diff] [blame] | 108 | ipmiallowlist, |
| 109 | ] |
| 110 | |
| 111 | zinteloemcmds_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 | |
| 121 | if get_option('tests').allowed() |
| 122 | subdir('tests') |
| 123 | endif |