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