project(
    'phosphor-objmgr',
    'c', 'cpp',
    default_options: [
        'buildtype=debugoptimized',
        'cpp_std=c++20',
        'warning_level=3',
        'werror=true',
    ],
    license: 'Apache-2.0',
    meson_version: '>=0.57.0',
    version: '1.0',
)

cxx = meson.get_compiler('cpp')

if cxx.has_header('CLI/CLI.hpp')
    cli11_dep = declare_dependency()
else
    cli11_dep = dependency('cli11')
endif
phosphor_logging = dependency('phosphor-logging')
phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
sdbusplus = dependency('sdbusplus')
boost = dependency('boost', version : '>=1.79.0', required: false, include_type: 'system')
if not boost.found()
  subproject('boost', required: false)
  boost_inc = include_directories('subprojects/boost_1_79_0/', is_system:true)
  boost  = declare_dependency(include_directories : boost_inc)
  boost = boost.as_system('system')
endif

if get_option('buildtype').startswith('debug')
    add_project_arguments('-DMAPPER_ENABLE_DEBUG', language : 'cpp')
endif

if get_option('tests').enabled()
    gtest = dependency('gtest', main: true, disabler: true, required: false)
    gmock = dependency('gmock', disabler: true, required: false)
    if not gtest.found() or not gmock.found()
        gtest_proj = import('cmake').subproject('googletest', required: false)
        if gtest_proj.found()
            gtest = declare_dependency(
                dependencies: [
                    dependency('threads'),
                    gtest_proj.dependency('gtest'),
                    gtest_proj.dependency('gtest_main'),
                ]
            )
            gmock = gtest_proj.dependency('gmock')
        else
            assert(
                not get_option('tests').enabled(),
                'Googletest is required if tests are enabled'
            )
        endif
    endif
    subdir('src/test')
    subdir('libmapper/test')
endif

install_headers('libmapper/mapper.h')

libmapper = library(
    'mapper',
    'libmapper/mapper.c',
    dependencies: [ dependency('libsystemd') ],
    gnu_symbol_visibility: 'hidden',
    version: meson.project_version(),
    install: true)

mapper_dep = declare_dependency(
    link_with: libmapper,
    include_directories: include_directories('libmapper'),
    dependencies: [ dependency('libsystemd') ],
)

import('pkgconfig').generate(
    name: 'libmapper',
    description: 'OpenBMC service discovery utility library',
    version: meson.project_version(),
    libraries: libmapper)

executable(
    'mapper',
    'libmapper/app.c',
    link_with: libmapper,
    dependencies: [ dependency('libsystemd') ],
    install: true)

executable(
    'mapperx',
    [
        'src/main.cpp',
        'src/processing.cpp',
        'src/associations.cpp',
        'src/handler.cpp',
    ],
    dependencies: [
        boost,
        dependency('libsystemd'),
        phosphor_dbus_interfaces,
        phosphor_logging,
        sdbusplus,
        dependency('systemd'),
        dependency('threads'),
        dependency('tinyxml2'),
    ],
    install: true,
    install_dir: join_paths(
        get_option('prefix'), get_option('libexecdir'), meson.project_name())
)

systemd_system_unit_dir = dependency('systemd').get_variable(
    pkgconfig : 'systemdsystemunitdir'
)

conf = configuration_data()
conf.set('BINDIR', join_paths(get_option('prefix'), get_option('bindir')))
conf.set('LIBEXECDIR', join_paths(
    get_option('prefix'), get_option('libexecdir')))

unit_files = [
    'xyz.openbmc_project.ObjectMapper.service',
    'mapper-subtree-remove@.service',
    'mapper-wait@.service'
]

foreach u : unit_files
    configure_file(
        configuration: conf,
        input : join_paths('src/systemd', u) + '.in',
        install : true,
        install_dir: systemd_system_unit_dir,
        output : u
    )
endforeach

dbus_system_bus_services_dir = dependency('dbus-1').get_variable(
    pkgconfig: 'system_bus_services_dir',
    pkgconfig_define: ['prefix', get_option('prefix')]
)

install_data(
    'src/dbus/xyz.openbmc_project.ObjectMapper.service',
    install_dir: dbus_system_bus_services_dir)

install_data(
    'src/dbus/xyz.openbmc_project.ObjectMapper.conf',
    install_dir: get_option('datadir') / 'dbus-1' / 'system.d')

if not get_option('unit-failure-monitor').disabled()
    executable(
        'phosphor-unit-failure-monitor',
        [
            'fail-monitor/main.cpp',
            'fail-monitor/monitor.cpp',
        ],
        dependencies: [
            cli11_dep,
            phosphor_logging,
        ],
        install: true
    )
endif
