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