xref: /openbmc/phosphor-net-ipmid/meson.build (revision 11c48351)
1project(
2    'phosphor-net-ipmid', 'cpp',
3    version : '1.0.0',
4    meson_version: '>=1.1.1',
5    default_options: [
6        'warning_level=3',
7        'werror=true',
8        'cpp_std=c++23',
9        'buildtype=debugoptimized',
10    ]
11)
12
13conf_data = configuration_data()
14conf_data.set('RMCP_PING', get_option('rmcp_ping').enabled())
15conf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').enabled())
16
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')
29mapper = dependency('libmapper')
30
31# Project Arguments
32cpp = meson.get_compiler('cpp')
33add_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
43deps = [
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
55sources = [
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
79executable(
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
89systemd = dependency('systemd')
90systemd_system_unit_dir = systemd.get_variable(
91        'systemdsystemunitdir',
92        pkgconfig_define: ['prefix', get_option('prefix')])
93
94configure_file(input: 'phosphor-ipmi-net@.service',
95                output: 'phosphor-ipmi-net@.service',
96                copy: true,
97                install_dir: systemd_system_unit_dir)
98
99configure_file(input: 'phosphor-ipmi-net@.socket',
100                output: 'phosphor-ipmi-net@.socket',
101                copy: true,
102                install_dir: systemd_system_unit_dir)
103
104build_tests = get_option('tests')
105if not build_tests.disabled()
106  subdir('test')
107endif
108