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