blob: 0e449d4106ccbd48b6b897e947cf55e5e6039b37 [file] [log] [blame]
George Liu94f781a2022-07-04 14:35:10 +08001project(
Patrick Williams888f0d32025-03-03 11:08:04 -05002 'phosphor-net-ipmid',
3 'cpp',
4 version: '1.0.0',
Patrick Williams11c48352023-07-12 11:15:22 -05005 meson_version: '>=1.1.1',
George Liu94f781a2022-07-04 14:35:10 +08006 default_options: [
7 'warning_level=3',
8 'werror=true',
Patrick Williams11c48352023-07-12 11:15:22 -05009 'cpp_std=c++23',
George Liu94f781a2022-07-04 14:35:10 +080010 'buildtype=debugoptimized',
Konstantin Aladyshev4c2ed9c2024-04-25 15:58:08 +030011 'b_lto=true',
Patrick Williams888f0d32025-03-03 11:08:04 -050012 ],
George Liu94f781a2022-07-04 14:35:10 +080013)
14
15conf_data = configuration_data()
Patrick Williams77f3e3c2025-01-30 17:47:30 -050016conf_data.set('RMCP_PING', get_option('rmcp_ping').allowed())
17conf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').allowed())
George Liu94f781a2022-07-04 14:35:10 +080018
Patrick Williams888f0d32025-03-03 11:08:04 -050019configure_file(output: 'config.h', configuration: conf_data)
George Liu94f781a2022-07-04 14:35:10 +080020
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(
Patrick Williams888f0d32025-03-03 11:08:04 -050039 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 Liu94f781a2022-07-04 14:35:10 +080050
51deps = [
George Liuc0552852024-02-04 09:09:32 +080052 cli11_dep,
George Liu94f781a2022-07-04 14:35:10 +080053 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 Liu94f781a2022-07-04 14:35:10 +080061]
62
63sources = [
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
87executable(
88 'netipmid',
89 sources,
90 implicit_include_directories: true,
91 include_directories: ['command', 'sol'],
92 dependencies: deps,
93 install: true,
Patrick Williams888f0d32025-03-03 11:08:04 -050094 install_dir: get_option('bindir'),
George Liu94f781a2022-07-04 14:35:10 +080095)
96
97systemd = dependency('systemd')
98systemd_system_unit_dir = systemd.get_variable(
Patrick Williams888f0d32025-03-03 11:08:04 -050099 'systemdsystemunitdir',
100 pkgconfig_define: ['prefix', get_option('prefix')],
101)
George Liu94f781a2022-07-04 14:35:10 +0800102
Patrick Williams888f0d32025-03-03 11:08:04 -0500103configure_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 Liu94f781a2022-07-04 14:35:10 +0800109
Patrick Williams888f0d32025-03-03 11:08:04 -0500110configure_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 Liu94f781a2022-07-04 14:35:10 +0800116
117build_tests = get_option('tests')
Patrick Williams77f3e3c2025-01-30 17:47:30 -0500118if build_tests.allowed()
Patrick Williams888f0d32025-03-03 11:08:04 -0500119 subdir('test')
George Liu94f781a2022-07-04 14:35:10 +0800120endif