Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 1 | project( |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 2 | 'fb-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 | ) |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 8 | |
| 9 | # Project Arguments |
| 10 | cpp = meson.get_compiler('cpp') |
| 11 | add_project_arguments( |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 12 | cpp.get_supported_arguments( |
| 13 | [ |
| 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 | '-Wno-psabi', |
| 22 | '-Wno-pedantic', |
| 23 | ], |
| 24 | ), |
| 25 | language: 'cpp', |
| 26 | ) |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 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') != '' |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 32 | host_instances = get_option('host-instances') |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 33 | endif |
| 34 | |
Jayashree Dhanapal | 4ec8056 | 2022-06-28 15:41:47 +0530 | [diff] [blame] | 35 | conf_data = configuration_data() |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 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 | |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 40 | configure_file( |
| 41 | input: 'meson_config.h.in', |
| 42 | output: 'config.h', |
| 43 | configuration: conf_data, |
| 44 | ) |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 45 | |
Patrick Williams | d50efc0 | 2025-01-30 17:47:12 -0500 | [diff] [blame] | 46 | if get_option('bic').allowed() |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 47 | add_project_arguments( |
| 48 | cpp.get_supported_arguments(['-DBIC_ENABLED']), |
| 49 | language: 'cpp', |
| 50 | ) |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 51 | endif |
| 52 | |
| 53 | root_inc = include_directories('.', 'include') |
| 54 | |
| 55 | # Dependencies |
Patrick Williams | 2e9921c | 2022-07-25 10:17:05 -0500 | [diff] [blame] | 56 | sdbusplus_dep = dependency('sdbusplus') |
| 57 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 58 | phosphor_logging_dep = dependency('phosphor-logging') |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 59 | ipmid_dep = dependency('libipmid') |
Patrick Williams | 2e9921c | 2022-07-25 10:17:05 -0500 | [diff] [blame] | 60 | channellayer_dep = dependency('libchannellayer') |
| 61 | userlayer_dep = dependency('libuserlayer') |
| 62 | |
Patrick Williams | 483f00a | 2023-12-07 17:05:54 -0600 | [diff] [blame] | 63 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 64 | |
| 65 | zfboemcmds_pre = declare_dependency( |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 66 | include_directories: root_inc, |
| 67 | dependencies: [ |
| 68 | channellayer_dep, |
| 69 | ipmid_dep, |
| 70 | nlohmann_json_dep, |
| 71 | phosphor_dbus_interfaces_dep, |
| 72 | phosphor_logging_dep, |
| 73 | sdbusplus_dep, |
| 74 | userlayer_dep, |
| 75 | ], |
| 76 | ) |
Willy Tu | e39f939 | 2022-06-15 13:24:20 -0700 | [diff] [blame] | 77 | |
Patrick Williams | 17bd2ea | 2022-06-24 16:44:51 -0500 | [diff] [blame] | 78 | zfboemcmds_lib = library( |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 79 | 'zfboemcmds', |
| 80 | 'src/commandutils.cpp', |
| 81 | 'src/oemcommands.cpp', |
| 82 | 'src/appcommands.cpp', |
| 83 | 'src/storagecommands.cpp', |
| 84 | 'src/usb-dbg.cpp', |
| 85 | 'src/selcommands.cpp', |
| 86 | 'src/transportcommands.cpp', |
| 87 | 'src/biccommands.cpp', |
| 88 | 'src/groupextcommands.cpp', |
| 89 | implicit_include_directories: false, |
| 90 | dependencies: zfboemcmds_pre, |
| 91 | version: meson.project_version(), |
| 92 | override_options: ['b_lundef=false'], |
| 93 | install: true, |
| 94 | install_dir: get_option('libdir') / 'ipmid-providers', |
| 95 | ) |
Karthikeyan Pasupathi | 3048dd5 | 2022-06-30 21:51:11 +0530 | [diff] [blame] | 96 | |
| 97 | if get_option('machine') != '' |
Patrick Williams | d147124 | 2025-02-01 08:36:16 -0500 | [diff] [blame] | 98 | configfile = ['cri_sensors.json', 'gpio_desc.json', 'post_desc.json'] |
| 99 | foreach c : configfile |
| 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 |
| 109 | endforeach |
Karthikeyan Pasupathi | 3048dd5 | 2022-06-30 21:51:11 +0530 | [diff] [blame] | 110 | endif |