blob: e1ee4f1d5826b61b11acdaaa0481da9f3cc11e8d [file] [log] [blame]
George Liu94f781a2022-07-04 14:35:10 +08001project(
2 'phosphor-net-ipmid', 'cpp',
3 version : '1.0.0',
Patrick Williams11c48352023-07-12 11:15:22 -05004 meson_version: '>=1.1.1',
George Liu94f781a2022-07-04 14:35:10 +08005 default_options: [
6 'warning_level=3',
7 'werror=true',
Patrick Williams11c48352023-07-12 11:15:22 -05008 'cpp_std=c++23',
George Liu94f781a2022-07-04 14:35:10 +08009 'buildtype=debugoptimized',
Konstantin Aladyshev4c2ed9c2024-04-25 15:58:08 +030010 'b_lto=true',
George Liu94f781a2022-07-04 14:35:10 +080011 ]
12)
13
14conf_data = configuration_data()
15conf_data.set('RMCP_PING', get_option('rmcp_ping').enabled())
Willy Tu2c95dd12023-03-03 16:26:44 -080016conf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').enabled())
George Liu94f781a2022-07-04 14:35:10 +080017
18configure_file(output: 'config.h',
19 configuration: conf_data
20)
21
22sdbusplus_dep = dependency('sdbusplus')
23phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
24phosphor_logging_dep = dependency('phosphor-logging')
25libsystemd_dep = dependency('libsystemd')
26libcrypto_dep = dependency('libcrypto')
27ipmid_dep = dependency('libipmid')
28userlayer_dep = dependency('libuserlayer')
29channellayer_dep = dependency('libchannellayer')
George Liu94f781a2022-07-04 14:35:10 +080030
31# Project Arguments
32cpp = meson.get_compiler('cpp')
George Liuc0552852024-02-04 09:09:32 +080033if cpp.has_header('CLI/CLI.hpp')
34 cli11_dep = declare_dependency()
35else
36 cli11_dep = dependency('CLI11')
37endif
38
George Liu94f781a2022-07-04 14:35:10 +080039add_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
49deps = [
George Liuc0552852024-02-04 09:09:32 +080050 cli11_dep,
George Liu94f781a2022-07-04 14:35:10 +080051 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 Liu94f781a2022-07-04 14:35:10 +080059]
60
61sources = [
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
85executable(
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
95systemd = dependency('systemd')
96systemd_system_unit_dir = systemd.get_variable(
Patrick Williamse81b7c92023-04-12 08:01:04 -050097 'systemdsystemunitdir',
George Liu94f781a2022-07-04 14:35:10 +080098 pkgconfig_define: ['prefix', get_option('prefix')])
99
100configure_file(input: 'phosphor-ipmi-net@.service',
101 output: 'phosphor-ipmi-net@.service',
102 copy: true,
103 install_dir: systemd_system_unit_dir)
104
105configure_file(input: 'phosphor-ipmi-net@.socket',
106 output: 'phosphor-ipmi-net@.socket',
107 copy: true,
108 install_dir: systemd_system_unit_dir)
109
110build_tests = get_option('tests')
111if not build_tests.disabled()
112 subdir('test')
113endif