xref: /openbmc/phosphor-net-ipmid/meson.build (revision 94f781a8)
1project(
2    'phosphor-net-ipmid', 'cpp',
3    version : '1.0.0',
4    meson_version: '>=0.58.0',
5    default_options: [
6        'warning_level=3',
7        'werror=true',
8        'cpp_std=c++20',
9        'buildtype=debugoptimized',
10    ]
11)
12
13conf_data = configuration_data()
14conf_data.set('RMCP_PING', get_option('rmcp_ping').enabled())
15
16configure_file(output: 'config.h',
17    configuration: conf_data
18)
19
20sdbusplus_dep = dependency('sdbusplus')
21phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
22phosphor_logging_dep = dependency('phosphor-logging')
23libsystemd_dep = dependency('libsystemd')
24libcrypto_dep = dependency('libcrypto')
25ipmid_dep = dependency('libipmid')
26userlayer_dep = dependency('libuserlayer')
27channellayer_dep = dependency('libchannellayer')
28mapper = dependency('libmapper')
29
30# Project Arguments
31cpp = meson.get_compiler('cpp')
32add_project_arguments(
33  cpp.get_supported_arguments([
34    '-DBOOST_ERROR_CODE_HEADER_ONLY',
35    '-DBOOST_SYSTEM_NO_DEPRECATED',
36    '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
37    '-DBOOST_ASIO_DISABLE_THREADS',
38    '-DBOOST_ALL_NO_LIB',
39  ]),
40  language : 'cpp')
41
42deps = [
43    ipmid_dep,
44    userlayer_dep,
45    channellayer_dep,
46    libcrypto_dep,
47    libsystemd_dep,
48    phosphor_dbus_interfaces_dep,
49    phosphor_logging_dep,
50    sdbusplus_dep,
51    mapper,
52]
53
54sources = [
55    'auth_algo.cpp',
56    'sessions_manager.cpp',
57    'message_parsers.cpp',
58    'message_handler.cpp',
59    'command_table.cpp',
60    'command/channel_auth.cpp',
61    'command/guid.cpp',
62    'command/open_session.cpp',
63    'command/rakp12.cpp',
64    'command/rakp34.cpp',
65    'command/session_cmds.cpp',
66    'comm_module.cpp',
67    'main.cpp',
68    'integrity_algo.cpp',
69    'crypt_algo.cpp',
70    'sd_event_loop.cpp',
71    'sol/sol_manager.cpp',
72    'sol/sol_context.cpp',
73    'command/sol_cmds.cpp',
74    'command/payload_cmds.cpp',
75    'sol_module.cpp',
76]
77
78executable(
79    'netipmid',
80    sources,
81    implicit_include_directories: true,
82    include_directories: ['command', 'sol'],
83    dependencies: deps,
84    install: true,
85    install_dir: get_option('bindir')
86)
87
88systemd = dependency('systemd')
89systemd_system_unit_dir = systemd.get_variable(
90        pkgconfig: 'systemdsystemunitdir',
91        pkgconfig_define: ['prefix', get_option('prefix')])
92
93configure_file(input: 'phosphor-ipmi-net@.service',
94                output: 'phosphor-ipmi-net@.service',
95                copy: true,
96                install_dir: systemd_system_unit_dir)
97
98configure_file(input: 'phosphor-ipmi-net@.socket',
99                output: 'phosphor-ipmi-net@.socket',
100                copy: true,
101                install_dir: systemd_system_unit_dir)
102
103build_tests = get_option('tests')
104if not build_tests.disabled()
105  subdir('test')
106endif
107