xref: /openbmc/openpower-debug-collector/meson.build (revision ac291d44b3822d6c9359f0397d7d4084b0954bd9)
1project(
2    'openpower-debug-collector',
3    'cpp',
4    meson_version: '>=1.1.1',
5    default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
6    license: 'Apache-2.0',
7    version: '1.0.0',
8)
9
10cxx = meson.get_compiler('cpp')
11
12sdbusplus_dep = dependency('sdbusplus')
13
14if cxx.has_header('CLI/CLI.hpp')
15    CLI11_dep = declare_dependency()
16else
17    CLI11_dep = dependency('CLI11')
18endif
19
20phosphorlogging = dependency(
21    'phosphor-logging',
22    fallback: ['phosphor-logging', 'phosphor_logging_dep'],
23)
24
25realpath_prog = find_program('realpath')
26
27conf_data = configuration_data()
28if get_option('hostboot-dump-collection').allowed()
29    conf_data.set('WATCHDOG_DUMP_COLLECTION', true)
30    extra_deps = [
31        cxx.find_library('pdbg'),
32        cxx.find_library('libdt-api'),
33        cxx.find_library('phal'),
34    ]
35    subdir('watchdog')
36else
37    conf_data.set('WATCHDOG_DUMP_COLLECTION', false)
38    watchdog_lib = []
39    extra_deps = []
40endif
41
42configure_file(output: 'config.h', configuration: conf_data)
43
44if get_option('dump-collection').allowed()
45    subdir('dump')
46endif
47
48deps = [CLI11_dep, sdbusplus_dep, phosphorlogging, extra_deps]
49
50executable(
51    'watchdog_timeout',
52    'watchdog_timeout.cpp',
53    dependencies: deps,
54    link_with: watchdog_lib,
55    implicit_include_directories: true,
56    install: true,
57)
58
59executable(
60    'checkstop_app',
61    'checkstop_app.cpp',
62    dependencies: deps,
63    implicit_include_directories: true,
64    install: true,
65)
66