Hieu Huynh | 90a4fb8 | 2022-08-02 07:21:03 +0000 | [diff] [blame] | 1 | project( |
| 2 | 'ampere-ipmi-oem', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
Thang Q. Nguyen | 7353a2b | 2023-08-16 13:12:11 +0700 | [diff] [blame] | 5 | meson_version: '>=1.1.1', |
Hieu Huynh | 90a4fb8 | 2022-08-02 07:21:03 +0000 | [diff] [blame] | 6 | default_options: [ |
| 7 | 'werror=true', |
| 8 | 'warning_level=3', |
Thang Q. Nguyen | 7353a2b | 2023-08-16 13:12:11 +0700 | [diff] [blame] | 9 | 'cpp_std=c++23', |
Hieu Huynh | 90a4fb8 | 2022-08-02 07:21:03 +0000 | [diff] [blame] | 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 | root_inc = include_directories('.', 'include') |
| 29 | |
| 30 | # Dependencies |
| 31 | phosphor_logging_dep = dependency('phosphor-logging') |
| 32 | sdbusplus_dep = dependency('sdbusplus', required : false, include_type: 'system') |
| 33 | ipmid_dep = dependency('libipmid') |
| 34 | channellayer_dep = cpp.find_library('channellayer', required: true) |
| 35 | userlayer_dep = cpp.find_library('userlayer', required: true) |
| 36 | |
Thang Tran | 2a19152 | 2022-11-01 18:09:37 +0700 | [diff] [blame] | 37 | mac_fru_bus = get_option('mac-address-fru-bus') |
| 38 | if mac_fru_bus >= 0 |
| 39 | add_project_arguments( |
| 40 | '-DMAC_ADDRESS_FRU_BUS=' + mac_fru_bus.to_string(), |
| 41 | language : 'cpp') |
| 42 | endif |
| 43 | |
| 44 | mac_fru_bus = get_option('mac-address-fru-addr') |
| 45 | if mac_fru_bus >= 8 and mac_fru_bus <=119 |
| 46 | add_project_arguments( |
| 47 | '-DMAC_ADDRESS_FRU_ADDR=' + mac_fru_bus.to_string(), |
| 48 | language : 'cpp') |
| 49 | endif |
| 50 | |
Hieu Huynh | 90a4fb8 | 2022-08-02 07:21:03 +0000 | [diff] [blame] | 51 | zampoemcmds_pre = declare_dependency( |
| 52 | include_directories: root_inc, |
| 53 | dependencies: [ |
| 54 | phosphor_logging_dep, |
| 55 | sdbusplus_dep, |
| 56 | ipmid_dep, |
| 57 | channellayer_dep, |
| 58 | userlayer_dep, |
| 59 | ]) |
| 60 | |
| 61 | zampoemcmds_lib = library( |
| 62 | 'zampoemcmds', |
| 63 | 'src/appcommands.cpp', |
| 64 | 'src/bridgingcommands.cpp', |
| 65 | 'src/oemcommands.cpp', |
| 66 | implicit_include_directories: false, |
| 67 | dependencies: zampoemcmds_pre, |
| 68 | version: meson.project_version(), |
| 69 | override_options: ['b_lundef=false'], |
| 70 | install: true, |
Thang Tran | 2a19152 | 2022-11-01 18:09:37 +0700 | [diff] [blame] | 71 | install_dir: get_option('libdir') / 'ipmid-providers') |