xref: /openbmc/phosphor-net-ipmid/meson.build (revision 4c2ed9c3)
194f781a8SGeorge Liuproject(
294f781a8SGeorge Liu    'phosphor-net-ipmid', 'cpp',
394f781a8SGeorge Liu    version : '1.0.0',
411c48351SPatrick Williams    meson_version: '>=1.1.1',
594f781a8SGeorge Liu    default_options: [
694f781a8SGeorge Liu        'warning_level=3',
794f781a8SGeorge Liu        'werror=true',
811c48351SPatrick Williams        'cpp_std=c++23',
994f781a8SGeorge Liu        'buildtype=debugoptimized',
10*4c2ed9c3SKonstantin Aladyshev        'b_lto=true',
1194f781a8SGeorge Liu    ]
1294f781a8SGeorge Liu)
1394f781a8SGeorge Liu
1494f781a8SGeorge Liuconf_data = configuration_data()
1594f781a8SGeorge Liuconf_data.set('RMCP_PING', get_option('rmcp_ping').enabled())
162c95dd1aSWilly Tuconf_data.set('PAM_AUTHENTICATE', get_option('pam_authenticate').enabled())
1794f781a8SGeorge Liu
1894f781a8SGeorge Liuconfigure_file(output: 'config.h',
1994f781a8SGeorge Liu    configuration: conf_data
2094f781a8SGeorge Liu)
2194f781a8SGeorge Liu
2294f781a8SGeorge Liusdbusplus_dep = dependency('sdbusplus')
2394f781a8SGeorge Liuphosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
2494f781a8SGeorge Liuphosphor_logging_dep = dependency('phosphor-logging')
2594f781a8SGeorge Liulibsystemd_dep = dependency('libsystemd')
2694f781a8SGeorge Liulibcrypto_dep = dependency('libcrypto')
2794f781a8SGeorge Liuipmid_dep = dependency('libipmid')
2894f781a8SGeorge Liuuserlayer_dep = dependency('libuserlayer')
2994f781a8SGeorge Liuchannellayer_dep = dependency('libchannellayer')
3094f781a8SGeorge Liu
3194f781a8SGeorge Liu# Project Arguments
3294f781a8SGeorge Liucpp = meson.get_compiler('cpp')
33c0552851SGeorge Liuif cpp.has_header('CLI/CLI.hpp')
34c0552851SGeorge Liu    cli11_dep = declare_dependency()
35c0552851SGeorge Liuelse
36c0552851SGeorge Liu    cli11_dep = dependency('CLI11')
37c0552851SGeorge Liuendif
38c0552851SGeorge Liu
3994f781a8SGeorge Liuadd_project_arguments(
4094f781a8SGeorge Liu  cpp.get_supported_arguments([
4194f781a8SGeorge Liu    '-DBOOST_ERROR_CODE_HEADER_ONLY',
4294f781a8SGeorge Liu    '-DBOOST_SYSTEM_NO_DEPRECATED',
4394f781a8SGeorge Liu    '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
4494f781a8SGeorge Liu    '-DBOOST_ASIO_DISABLE_THREADS',
4594f781a8SGeorge Liu    '-DBOOST_ALL_NO_LIB',
4694f781a8SGeorge Liu  ]),
4794f781a8SGeorge Liu  language : 'cpp')
4894f781a8SGeorge Liu
4994f781a8SGeorge Liudeps = [
50c0552851SGeorge Liu    cli11_dep,
5194f781a8SGeorge Liu    ipmid_dep,
5294f781a8SGeorge Liu    userlayer_dep,
5394f781a8SGeorge Liu    channellayer_dep,
5494f781a8SGeorge Liu    libcrypto_dep,
5594f781a8SGeorge Liu    libsystemd_dep,
5694f781a8SGeorge Liu    phosphor_dbus_interfaces_dep,
5794f781a8SGeorge Liu    phosphor_logging_dep,
5894f781a8SGeorge Liu    sdbusplus_dep,
5994f781a8SGeorge Liu]
6094f781a8SGeorge Liu
6194f781a8SGeorge Liusources = [
6294f781a8SGeorge Liu    'auth_algo.cpp',
6394f781a8SGeorge Liu    'sessions_manager.cpp',
6494f781a8SGeorge Liu    'message_parsers.cpp',
6594f781a8SGeorge Liu    'message_handler.cpp',
6694f781a8SGeorge Liu    'command_table.cpp',
6794f781a8SGeorge Liu    'command/channel_auth.cpp',
6894f781a8SGeorge Liu    'command/guid.cpp',
6994f781a8SGeorge Liu    'command/open_session.cpp',
7094f781a8SGeorge Liu    'command/rakp12.cpp',
7194f781a8SGeorge Liu    'command/rakp34.cpp',
7294f781a8SGeorge Liu    'command/session_cmds.cpp',
7394f781a8SGeorge Liu    'comm_module.cpp',
7494f781a8SGeorge Liu    'main.cpp',
7594f781a8SGeorge Liu    'integrity_algo.cpp',
7694f781a8SGeorge Liu    'crypt_algo.cpp',
7794f781a8SGeorge Liu    'sd_event_loop.cpp',
7894f781a8SGeorge Liu    'sol/sol_manager.cpp',
7994f781a8SGeorge Liu    'sol/sol_context.cpp',
8094f781a8SGeorge Liu    'command/sol_cmds.cpp',
8194f781a8SGeorge Liu    'command/payload_cmds.cpp',
8294f781a8SGeorge Liu    'sol_module.cpp',
8394f781a8SGeorge Liu]
8494f781a8SGeorge Liu
8594f781a8SGeorge Liuexecutable(
8694f781a8SGeorge Liu    'netipmid',
8794f781a8SGeorge Liu    sources,
8894f781a8SGeorge Liu    implicit_include_directories: true,
8994f781a8SGeorge Liu    include_directories: ['command', 'sol'],
9094f781a8SGeorge Liu    dependencies: deps,
9194f781a8SGeorge Liu    install: true,
9294f781a8SGeorge Liu    install_dir: get_option('bindir')
9394f781a8SGeorge Liu)
9494f781a8SGeorge Liu
9594f781a8SGeorge Liusystemd = dependency('systemd')
9694f781a8SGeorge Liusystemd_system_unit_dir = systemd.get_variable(
97e81b7c9dSPatrick Williams        'systemdsystemunitdir',
9894f781a8SGeorge Liu        pkgconfig_define: ['prefix', get_option('prefix')])
9994f781a8SGeorge Liu
10094f781a8SGeorge Liuconfigure_file(input: 'phosphor-ipmi-net@.service',
10194f781a8SGeorge Liu                output: 'phosphor-ipmi-net@.service',
10294f781a8SGeorge Liu                copy: true,
10394f781a8SGeorge Liu                install_dir: systemd_system_unit_dir)
10494f781a8SGeorge Liu
10594f781a8SGeorge Liuconfigure_file(input: 'phosphor-ipmi-net@.socket',
10694f781a8SGeorge Liu                output: 'phosphor-ipmi-net@.socket',
10794f781a8SGeorge Liu                copy: true,
10894f781a8SGeorge Liu                install_dir: systemd_system_unit_dir)
10994f781a8SGeorge Liu
11094f781a8SGeorge Liubuild_tests = get_option('tests')
11194f781a8SGeorge Liuif not build_tests.disabled()
11294f781a8SGeorge Liu  subdir('test')
11394f781a8SGeorge Liuendif
114