xref: /openbmc/telemetry/meson.build (revision cb88cfdf)
164b75a5bSKrzysztof Grobelnyproject(
264b75a5bSKrzysztof Grobelny    'Telemetry',
364b75a5bSKrzysztof Grobelny    'cpp',
464b75a5bSKrzysztof Grobelny    meson_version: '>=0.55.0',
564b75a5bSKrzysztof Grobelny    default_options: [
664b75a5bSKrzysztof Grobelny        'buildtype=debugoptimized',
764b75a5bSKrzysztof Grobelny        'cpp_std=c++17',
864b75a5bSKrzysztof Grobelny        'cpp_rtti=false',
964b75a5bSKrzysztof Grobelny        'warning_level=3',
1064b75a5bSKrzysztof Grobelny        'werror=true',
1164b75a5bSKrzysztof Grobelny        'b_lto=true',
1264b75a5bSKrzysztof Grobelny    ],
1364b75a5bSKrzysztof Grobelny    license: 'Apache-2.0',
1464b75a5bSKrzysztof Grobelny)
1564b75a5bSKrzysztof Grobelny
1664b75a5bSKrzysztof Grobelnycpp = meson.get_compiler('cpp')
1764b75a5bSKrzysztof Grobelnyadd_project_arguments(
1864b75a5bSKrzysztof Grobelny    cpp.get_supported_arguments([
1964b75a5bSKrzysztof Grobelny        '-DBOOST_ASIO_DISABLE_THREADS',
2064b75a5bSKrzysztof Grobelny        '-DBOOST_ALL_NO_LIB',
2164b75a5bSKrzysztof Grobelny        '-DBOOST_SYSTEM_NO_DEPRECATED',
2264b75a5bSKrzysztof Grobelny        '-DBOOST_ASIO_NO_DEPRECATED',
2364b75a5bSKrzysztof Grobelny        '-DBOOST_NO_RTTI',
2464b75a5bSKrzysztof Grobelny        '-DBOOST_NO_TYPEID',
2564b75a5bSKrzysztof Grobelny        '-Wno-unused-parameter',
2664b75a5bSKrzysztof Grobelny    ]),
2764b75a5bSKrzysztof Grobelny    language: 'cpp'
2864b75a5bSKrzysztof Grobelny)
2964b75a5bSKrzysztof Grobelny
3064b75a5bSKrzysztof Grobelnyboost = dependency('boost', version: '>=1.73.0', required: false)
3164b75a5bSKrzysztof Grobelnyif not boost.found()
3264b75a5bSKrzysztof Grobelny    subproject('boost', required: false)
3364b75a5bSKrzysztof Grobelny    boost  = declare_dependency(include_directories: 'subprojects/boost_1_73_0')
3464b75a5bSKrzysztof Grobelnyendif
3564b75a5bSKrzysztof Grobelny
3664b75a5bSKrzysztof Grobelnyphosphor_logging = dependency('phosphor-logging', required: false)
3764b75a5bSKrzysztof Grobelnyif not phosphor_logging.found()
3864b75a5bSKrzysztof Grobelny    subproject('phosphor-logging', required: false)
3964b75a5bSKrzysztof Grobelny    phosphor_logging = declare_dependency(
4064b75a5bSKrzysztof Grobelny        include_directories: 'subprojects/phosphor-logging'
4164b75a5bSKrzysztof Grobelny    )
4264b75a5bSKrzysztof Grobelnyendif
4364b75a5bSKrzysztof Grobelny
4464b75a5bSKrzysztof Grobelnysdbusplus = dependency('sdbusplus',required : false)
4564b75a5bSKrzysztof Grobelnyif not sdbusplus.found()
4664b75a5bSKrzysztof Grobelny  sdbusplus_proj = subproject('sdbusplus', required: true)
4764b75a5bSKrzysztof Grobelny  sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
4864b75a5bSKrzysztof Grobelnyendif
4964b75a5bSKrzysztof Grobelny
5064b75a5bSKrzysztof Grobelnysystemd = dependency('systemd')
5164b75a5bSKrzysztof Grobelny
5264b75a5bSKrzysztof Grobelnyexecutable(
5364b75a5bSKrzysztof Grobelny    'telemetry',
5464b75a5bSKrzysztof Grobelny    [
5564b75a5bSKrzysztof Grobelny        'src/main.cpp',
56*cb88cfdfSWludzik, Jozef        'src/report.cpp',
5764b75a5bSKrzysztof Grobelny        'src/report_manager.cpp',
5864b75a5bSKrzysztof Grobelny    ],
5964b75a5bSKrzysztof Grobelny    dependencies: [
6064b75a5bSKrzysztof Grobelny        boost,
6164b75a5bSKrzysztof Grobelny        sdbusplus,
6264b75a5bSKrzysztof Grobelny        phosphor_logging,
6364b75a5bSKrzysztof Grobelny    ],
6464b75a5bSKrzysztof Grobelny    include_directories: 'src',
6564b75a5bSKrzysztof Grobelny    install: true,
6664b75a5bSKrzysztof Grobelny    install_dir: get_option('prefix') / get_option('bindir'),
6764b75a5bSKrzysztof Grobelny    pie: true,
6864b75a5bSKrzysztof Grobelny)
6964b75a5bSKrzysztof Grobelny
7064b75a5bSKrzysztof Grobelnyconfigure_file(
7164b75a5bSKrzysztof Grobelny    input: 'xyz.openbmc_project.Telemetry.service.in',
7264b75a5bSKrzysztof Grobelny    output: 'xyz.openbmc_project.Telemetry.service',
7364b75a5bSKrzysztof Grobelny    configuration: {
7464b75a5bSKrzysztof Grobelny        'bindir': get_option('prefix') / get_option('bindir'),
7564b75a5bSKrzysztof Grobelny    },
7664b75a5bSKrzysztof Grobelny    install: true,
7764b75a5bSKrzysztof Grobelny    install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
7864b75a5bSKrzysztof Grobelny)
79