George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 1 | project( |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 2 | 'phosphor-net-ipmid', |
| 3 | 'cpp', |
| 4 | version: '1.0.0', |
Patrick Williams | 11c4835 | 2023-07-12 11:15:22 -0500 | [diff] [blame] | 5 | meson_version: '>=1.1.1', |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 6 | default_options: [ |
| 7 | 'warning_level=3', |
| 8 | 'werror=true', |
Patrick Williams | 11c4835 | 2023-07-12 11:15:22 -0500 | [diff] [blame] | 9 | 'cpp_std=c++23', |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 10 | 'buildtype=debugoptimized', |
Konstantin Aladyshev | 4c2ed9c | 2024-04-25 15:58:08 +0300 | [diff] [blame] | 11 | 'b_lto=true', |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 12 | ], |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 13 | ) |
| 14 | |
| 15 | conf_data = configuration_data() |
Patrick Williams | 77f3e3c | 2025-01-30 17:47:30 -0500 | [diff] [blame] | 16 | conf_data.set('RMCP_PING', get_option('rmcp_ping').allowed()) |
| 17 | conf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').allowed()) |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 18 | |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 19 | configure_file(output: 'config.h', configuration: conf_data) |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 20 | |
| 21 | sdbusplus_dep = dependency('sdbusplus') |
| 22 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 23 | phosphor_logging_dep = dependency('phosphor-logging') |
| 24 | libsystemd_dep = dependency('libsystemd') |
| 25 | libcrypto_dep = dependency('libcrypto') |
| 26 | ipmid_dep = dependency('libipmid') |
| 27 | userlayer_dep = dependency('libuserlayer') |
| 28 | channellayer_dep = dependency('libchannellayer') |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 29 | |
| 30 | # Project Arguments |
| 31 | cpp = meson.get_compiler('cpp') |
George Liu | c055285 | 2024-02-04 09:09:32 +0800 | [diff] [blame] | 32 | if cpp.has_header('CLI/CLI.hpp') |
| 33 | cli11_dep = declare_dependency() |
| 34 | else |
| 35 | cli11_dep = dependency('CLI11') |
| 36 | endif |
| 37 | |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 38 | add_project_arguments( |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 39 | cpp.get_supported_arguments( |
| 40 | [ |
| 41 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 42 | '-DBOOST_SYSTEM_NO_DEPRECATED', |
| 43 | '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING', |
| 44 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 45 | '-DBOOST_ALL_NO_LIB', |
| 46 | ], |
| 47 | ), |
| 48 | language: 'cpp', |
| 49 | ) |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 50 | |
| 51 | deps = [ |
George Liu | c055285 | 2024-02-04 09:09:32 +0800 | [diff] [blame] | 52 | cli11_dep, |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 53 | ipmid_dep, |
| 54 | userlayer_dep, |
| 55 | channellayer_dep, |
| 56 | libcrypto_dep, |
| 57 | libsystemd_dep, |
| 58 | phosphor_dbus_interfaces_dep, |
| 59 | phosphor_logging_dep, |
| 60 | sdbusplus_dep, |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 61 | ] |
| 62 | |
| 63 | sources = [ |
| 64 | 'auth_algo.cpp', |
| 65 | 'sessions_manager.cpp', |
| 66 | 'message_parsers.cpp', |
| 67 | 'message_handler.cpp', |
| 68 | 'command_table.cpp', |
| 69 | 'command/channel_auth.cpp', |
| 70 | 'command/guid.cpp', |
| 71 | 'command/open_session.cpp', |
| 72 | 'command/rakp12.cpp', |
| 73 | 'command/rakp34.cpp', |
| 74 | 'command/session_cmds.cpp', |
| 75 | 'comm_module.cpp', |
| 76 | 'main.cpp', |
| 77 | 'integrity_algo.cpp', |
| 78 | 'crypt_algo.cpp', |
| 79 | 'sd_event_loop.cpp', |
| 80 | 'sol/sol_manager.cpp', |
| 81 | 'sol/sol_context.cpp', |
| 82 | 'command/sol_cmds.cpp', |
| 83 | 'command/payload_cmds.cpp', |
| 84 | 'sol_module.cpp', |
| 85 | ] |
| 86 | |
| 87 | executable( |
| 88 | 'netipmid', |
| 89 | sources, |
| 90 | implicit_include_directories: true, |
| 91 | include_directories: ['command', 'sol'], |
| 92 | dependencies: deps, |
| 93 | install: true, |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 94 | install_dir: get_option('bindir'), |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 95 | ) |
| 96 | |
| 97 | systemd = dependency('systemd') |
| 98 | systemd_system_unit_dir = systemd.get_variable( |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 99 | 'systemdsystemunitdir', |
| 100 | pkgconfig_define: ['prefix', get_option('prefix')], |
| 101 | ) |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 102 | |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 103 | configure_file( |
| 104 | input: 'phosphor-ipmi-net@.service', |
| 105 | output: 'phosphor-ipmi-net@.service', |
| 106 | copy: true, |
| 107 | install_dir: systemd_system_unit_dir, |
| 108 | ) |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 109 | |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 110 | configure_file( |
| 111 | input: 'phosphor-ipmi-net@.socket', |
| 112 | output: 'phosphor-ipmi-net@.socket', |
| 113 | copy: true, |
| 114 | install_dir: systemd_system_unit_dir, |
| 115 | ) |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 116 | |
| 117 | build_tests = get_option('tests') |
Patrick Williams | 77f3e3c | 2025-01-30 17:47:30 -0500 | [diff] [blame] | 118 | if build_tests.allowed() |
Patrick Williams | 888f0d3 | 2025-03-03 11:08:04 -0500 | [diff] [blame^] | 119 | subdir('test') |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 120 | endif |