blob: 72f3ccfeabcd76fd6164f7f5f8f1ea7f06fb2d3e [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',
10 ]
11)
12
13conf_data = configuration_data()
14conf_data.set('RMCP_PING', get_option('rmcp_ping').enabled())
Willy Tu2c95dd12023-03-03 16:26:44 -080015conf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').enabled())
George Liu94f781a2022-07-04 14:35:10 +080016
17configure_file(output: 'config.h',
18 configuration: conf_data
19)
20
21sdbusplus_dep = dependency('sdbusplus')
22phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
23phosphor_logging_dep = dependency('phosphor-logging')
24libsystemd_dep = dependency('libsystemd')
25libcrypto_dep = dependency('libcrypto')
26ipmid_dep = dependency('libipmid')
27userlayer_dep = dependency('libuserlayer')
28channellayer_dep = dependency('libchannellayer')
George Liu94f781a2022-07-04 14:35:10 +080029
30# Project Arguments
31cpp = meson.get_compiler('cpp')
George Liuc0552852024-02-04 09:09:32 +080032if cpp.has_header('CLI/CLI.hpp')
33 cli11_dep = declare_dependency()
34else
35 cli11_dep = dependency('CLI11')
36endif
37
George Liu94f781a2022-07-04 14:35:10 +080038add_project_arguments(
39 cpp.get_supported_arguments([
40 '-DBOOST_ERROR_CODE_HEADER_ONLY',
41 '-DBOOST_SYSTEM_NO_DEPRECATED',
42 '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
43 '-DBOOST_ASIO_DISABLE_THREADS',
44 '-DBOOST_ALL_NO_LIB',
45 ]),
46 language : 'cpp')
47
48deps = [
George Liuc0552852024-02-04 09:09:32 +080049 cli11_dep,
George Liu94f781a2022-07-04 14:35:10 +080050 ipmid_dep,
51 userlayer_dep,
52 channellayer_dep,
53 libcrypto_dep,
54 libsystemd_dep,
55 phosphor_dbus_interfaces_dep,
56 phosphor_logging_dep,
57 sdbusplus_dep,
George Liu94f781a2022-07-04 14:35:10 +080058]
59
60sources = [
61 'auth_algo.cpp',
62 'sessions_manager.cpp',
63 'message_parsers.cpp',
64 'message_handler.cpp',
65 'command_table.cpp',
66 'command/channel_auth.cpp',
67 'command/guid.cpp',
68 'command/open_session.cpp',
69 'command/rakp12.cpp',
70 'command/rakp34.cpp',
71 'command/session_cmds.cpp',
72 'comm_module.cpp',
73 'main.cpp',
74 'integrity_algo.cpp',
75 'crypt_algo.cpp',
76 'sd_event_loop.cpp',
77 'sol/sol_manager.cpp',
78 'sol/sol_context.cpp',
79 'command/sol_cmds.cpp',
80 'command/payload_cmds.cpp',
81 'sol_module.cpp',
82]
83
84executable(
85 'netipmid',
86 sources,
87 implicit_include_directories: true,
88 include_directories: ['command', 'sol'],
89 dependencies: deps,
90 install: true,
91 install_dir: get_option('bindir')
92)
93
94systemd = dependency('systemd')
95systemd_system_unit_dir = systemd.get_variable(
Patrick Williamse81b7c92023-04-12 08:01:04 -050096 'systemdsystemunitdir',
George Liu94f781a2022-07-04 14:35:10 +080097 pkgconfig_define: ['prefix', get_option('prefix')])
98
99configure_file(input: 'phosphor-ipmi-net@.service',
100 output: 'phosphor-ipmi-net@.service',
101 copy: true,
102 install_dir: systemd_system_unit_dir)
103
104configure_file(input: 'phosphor-ipmi-net@.socket',
105 output: 'phosphor-ipmi-net@.socket',
106 copy: true,
107 install_dir: systemd_system_unit_dir)
108
109build_tests = get_option('tests')
110if not build_tests.disabled()
111 subdir('test')
112endif