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', |
| 10 | ] |
| 11 | ) |
| 12 | |
| 13 | conf_data = configuration_data() |
| 14 | conf_data.set('RMCP_PING', get_option('rmcp_ping').enabled()) |
Willy Tu | 2c95dd1 | 2023-03-03 16:26:44 -0800 | [diff] [blame] | 15 | conf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').enabled()) |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 16 | |
| 17 | configure_file(output: 'config.h', |
| 18 | configuration: conf_data |
| 19 | ) |
| 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') |
| 29 | mapper = dependency('libmapper') |
| 30 | |
| 31 | # Project Arguments |
| 32 | cpp = meson.get_compiler('cpp') |
| 33 | add_project_arguments( |
| 34 | cpp.get_supported_arguments([ |
| 35 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 36 | '-DBOOST_SYSTEM_NO_DEPRECATED', |
| 37 | '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING', |
| 38 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 39 | '-DBOOST_ALL_NO_LIB', |
| 40 | ]), |
| 41 | language : 'cpp') |
| 42 | |
| 43 | deps = [ |
| 44 | ipmid_dep, |
| 45 | userlayer_dep, |
| 46 | channellayer_dep, |
| 47 | libcrypto_dep, |
| 48 | libsystemd_dep, |
| 49 | phosphor_dbus_interfaces_dep, |
| 50 | phosphor_logging_dep, |
| 51 | sdbusplus_dep, |
| 52 | mapper, |
| 53 | ] |
| 54 | |
| 55 | sources = [ |
| 56 | 'auth_algo.cpp', |
| 57 | 'sessions_manager.cpp', |
| 58 | 'message_parsers.cpp', |
| 59 | 'message_handler.cpp', |
| 60 | 'command_table.cpp', |
| 61 | 'command/channel_auth.cpp', |
| 62 | 'command/guid.cpp', |
| 63 | 'command/open_session.cpp', |
| 64 | 'command/rakp12.cpp', |
| 65 | 'command/rakp34.cpp', |
| 66 | 'command/session_cmds.cpp', |
| 67 | 'comm_module.cpp', |
| 68 | 'main.cpp', |
| 69 | 'integrity_algo.cpp', |
| 70 | 'crypt_algo.cpp', |
| 71 | 'sd_event_loop.cpp', |
| 72 | 'sol/sol_manager.cpp', |
| 73 | 'sol/sol_context.cpp', |
| 74 | 'command/sol_cmds.cpp', |
| 75 | 'command/payload_cmds.cpp', |
| 76 | 'sol_module.cpp', |
| 77 | ] |
| 78 | |
| 79 | executable( |
| 80 | 'netipmid', |
| 81 | sources, |
| 82 | implicit_include_directories: true, |
| 83 | include_directories: ['command', 'sol'], |
| 84 | dependencies: deps, |
| 85 | install: true, |
| 86 | install_dir: get_option('bindir') |
| 87 | ) |
| 88 | |
| 89 | systemd = dependency('systemd') |
| 90 | systemd_system_unit_dir = systemd.get_variable( |
Patrick Williams | e81b7c9 | 2023-04-12 08:01:04 -0500 | [diff] [blame] | 91 | 'systemdsystemunitdir', |
George Liu | 94f781a | 2022-07-04 14:35:10 +0800 | [diff] [blame] | 92 | pkgconfig_define: ['prefix', get_option('prefix')]) |
| 93 | |
| 94 | configure_file(input: 'phosphor-ipmi-net@.service', |
| 95 | output: 'phosphor-ipmi-net@.service', |
| 96 | copy: true, |
| 97 | install_dir: systemd_system_unit_dir) |
| 98 | |
| 99 | configure_file(input: 'phosphor-ipmi-net@.socket', |
| 100 | output: 'phosphor-ipmi-net@.socket', |
| 101 | copy: true, |
| 102 | install_dir: systemd_system_unit_dir) |
| 103 | |
| 104 | build_tests = get_option('tests') |
| 105 | if not build_tests.disabled() |
| 106 | subdir('test') |
| 107 | endif |