Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'fb-ipmi-oem', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
Patrick Williams | 7c24dde | 2023-07-12 11:15:07 -0500 | [diff] [blame] | 5 | meson_version: '>=1.1.1', |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 6 | default_options: [ |
| 7 | 'werror=true', |
| 8 | 'warning_level=3', |
Patrick Williams | 7c24dde | 2023-07-12 11:15:07 -0500 | [diff] [blame] | 9 | 'cpp_std=c++23', |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [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 | |
Patrick Williams | 708286a | 2022-07-25 09:49:50 -0500 | [diff] [blame] | 28 | fs = import('fs') |
| 29 | |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 30 | host_instances = '0' |
| 31 | if get_option('host-instances') != '' |
| 32 | host_instances = get_option('host-instances') |
| 33 | endif |
| 34 | |
Jayashree Dhanapal | 4ec8056 | 2022-06-28 15:41:47 +0530 | [diff] [blame] | 35 | conf_data = configuration_data() |
| 36 | conf_data.set_quoted('INSTANCES',host_instances) |
Bonnie Lo | 4ae63e7 | 2023-02-09 15:27:54 +0800 | [diff] [blame] | 37 | conf_data.set('POST_CODE_BYTES', get_option('post-code-bytes')) |
Peter Yin | b340aa2 | 2024-07-08 16:07:55 +0800 | [diff] [blame^] | 38 | conf_data.set('DEBUG_CARD_FRAME_SIZE', get_option('debug-card-frame-size')) |
Jayashree Dhanapal | 4ec8056 | 2022-06-28 15:41:47 +0530 | [diff] [blame] | 39 | |
| 40 | configure_file(input: 'meson_config.h.in', |
| 41 | output: 'config.h', |
| 42 | configuration: conf_data) |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 43 | |
| 44 | if not get_option('bic').disabled() |
| 45 | add_project_arguments( |
| 46 | cpp.get_supported_arguments([ |
| 47 | '-DBIC_ENABLED', |
| 48 | ]), |
| 49 | language : 'cpp') |
| 50 | endif |
| 51 | |
| 52 | root_inc = include_directories('.', 'include') |
| 53 | |
| 54 | # Dependencies |
Patrick Williams | 2e9921c | 2022-07-25 10:17:05 -0500 | [diff] [blame] | 55 | sdbusplus_dep = dependency('sdbusplus') |
| 56 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 57 | phosphor_logging_dep = dependency('phosphor-logging') |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 58 | ipmid_dep = dependency('libipmid') |
Patrick Williams | 2e9921c | 2022-07-25 10:17:05 -0500 | [diff] [blame] | 59 | channellayer_dep = dependency('libchannellayer') |
| 60 | userlayer_dep = dependency('libuserlayer') |
| 61 | |
Patrick Williams | 483f00a | 2023-12-07 17:05:54 -0600 | [diff] [blame] | 62 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 63 | |
| 64 | zfboemcmds_pre = declare_dependency( |
| 65 | include_directories: root_inc, |
| 66 | dependencies: [ |
Patrick Williams | 2e9921c | 2022-07-25 10:17:05 -0500 | [diff] [blame] | 67 | channellayer_dep, |
| 68 | ipmid_dep, |
| 69 | nlohmann_json_dep, |
| 70 | phosphor_dbus_interfaces_dep, |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 71 | phosphor_logging_dep, |
| 72 | sdbusplus_dep, |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 73 | userlayer_dep, |
| 74 | ]) |
| 75 | |
Patrick Williams | 17bd2ea | 2022-06-24 16:44:51 -0500 | [diff] [blame] | 76 | zfboemcmds_lib = library( |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 77 | 'zfboemcmds', |
cchoux | b2ae88b | 2023-09-13 00:35:36 +0800 | [diff] [blame] | 78 | 'src/commandutils.cpp', |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 79 | 'src/oemcommands.cpp', |
| 80 | 'src/appcommands.cpp', |
| 81 | 'src/storagecommands.cpp', |
| 82 | 'src/usb-dbg.cpp', |
| 83 | 'src/selcommands.cpp', |
| 84 | 'src/transportcommands.cpp', |
| 85 | 'src/biccommands.cpp', |
| 86 | implicit_include_directories: false, |
| 87 | dependencies: zfboemcmds_pre, |
Patrick Williams | 17bd2ea | 2022-06-24 16:44:51 -0500 | [diff] [blame] | 88 | version: meson.project_version(), |
| 89 | override_options: ['b_lundef=false'], |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 90 | install: true, |
| 91 | install_dir: get_option('libdir') / 'ipmid-providers') |
Karthikeyan Pasupathi | 3048dd5 | 2022-06-30 21:51:11 +0530 | [diff] [blame] | 92 | |
| 93 | if get_option('machine') != '' |
| 94 | configfile = [ |
| 95 | 'cri_sensors.json', |
| 96 | 'gpio_desc.json', |
| 97 | 'post_desc.json' |
| 98 | ] |
| 99 | foreach c : configfile |
Patrick Williams | 708286a | 2022-07-25 09:49:50 -0500 | [diff] [blame] | 100 | file = join_paths('configs', get_option('machine'), c) |
| 101 | if not fs.is_file(file) |
| 102 | warning('Missing config file: ' + file) |
| 103 | else |
| 104 | install_data( |
| 105 | sources : file, |
| 106 | install_dir : get_option('datadir') / 'lcd-debug' |
| 107 | ) |
| 108 | endif |
Karthikeyan Pasupathi | 3048dd5 | 2022-06-30 21:51:11 +0530 | [diff] [blame] | 109 | endforeach |
| 110 | endif |