Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'fb-ipmi-oem', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
| 5 | meson_version: '>=0.57.0', |
| 6 | default_options: [ |
| 7 | 'werror=true', |
| 8 | 'warning_level=3', |
| 9 | 'cpp_std=c++20', |
| 10 | ]) |
| 11 | |
| 12 | # Project Arguments |
| 13 | cpp = meson.get_compiler('cpp') |
| 14 | add_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 | |
| 28 | host_instances = '0' |
| 29 | if get_option('host-instances') != '' |
| 30 | host_instances = get_option('host-instances') |
| 31 | endif |
| 32 | |
| 33 | add_project_arguments( |
| 34 | cpp.get_supported_arguments([ |
| 35 | '-DINSTANCES=' + host_instances, |
| 36 | ]), |
| 37 | language : 'cpp') |
| 38 | |
| 39 | if not get_option('bic').disabled() |
| 40 | add_project_arguments( |
| 41 | cpp.get_supported_arguments([ |
| 42 | '-DBIC_ENABLED', |
| 43 | ]), |
| 44 | language : 'cpp') |
| 45 | endif |
| 46 | |
| 47 | root_inc = include_directories('.', 'include') |
| 48 | |
| 49 | # Dependencies |
| 50 | phosphor_logging_dep = dependency('phosphor-logging') |
| 51 | sdbusplus_dep = dependency('sdbusplus', required : false, include_type: 'system') |
| 52 | ipmid_dep = dependency('libipmid') |
| 53 | channellayer_dep = cpp.find_library('channellayer', required: true) |
| 54 | userlayer_dep = cpp.find_library('userlayer', required: true) |
| 55 | |
| 56 | zfboemcmds_pre = declare_dependency( |
| 57 | include_directories: root_inc, |
| 58 | dependencies: [ |
| 59 | phosphor_logging_dep, |
| 60 | sdbusplus_dep, |
| 61 | ipmid_dep, |
| 62 | channellayer_dep, |
| 63 | userlayer_dep, |
| 64 | ]) |
| 65 | |
| 66 | zfboemcmds_lib = shared_module( |
| 67 | 'zfboemcmds', |
| 68 | 'src/oemcommands.cpp', |
| 69 | 'src/appcommands.cpp', |
| 70 | 'src/storagecommands.cpp', |
| 71 | 'src/usb-dbg.cpp', |
| 72 | 'src/selcommands.cpp', |
| 73 | 'src/transportcommands.cpp', |
| 74 | 'src/biccommands.cpp', |
| 75 | implicit_include_directories: false, |
| 76 | dependencies: zfboemcmds_pre, |
| 77 | install: true, |
| 78 | install_dir: get_option('libdir') / 'ipmid-providers') |