1# SPDX-License-Identifier: Apache-2.0
2
3cxx = meson.get_compiler('cpp')
4
5sdeventplus_dep = dependency('sdeventplus')
6
7collect_deps = [
8   CLI11_dep,
9   phosphorlogging,
10   cxx.find_library('pdbg'),
11   cxx.find_library('libdt-api'),
12   cxx.find_library('phal'),
13]
14
15monitor_deps = [
16    sdbusplus_dep,
17    phosphorlogging,
18]
19
20# source files
21
22collect_src = files(
23    'sbe_dump_collector.cpp',
24    'dump_collect_main.cpp',
25    'dump_utils.cpp',
26    'create_pel.cpp',
27    'dump_utils.cpp',
28    'sbe_type.cpp',
29)
30
31monitor_src = files(
32    'dump_monitor.cpp',
33    'dump_monitor_main.cpp',
34    'dump_utils.cpp',
35)
36
37executable('dump-collect',
38    collect_src,
39    dependencies: collect_deps,
40    implicit_include_directories: true,
41    install: true
42)
43
44executable('openpower-dump-monitor',
45    monitor_src,
46    dependencies: monitor_deps,
47    implicit_include_directories: true,
48    install: true
49)
50
51bindir = get_option('bindir')
52dreport_include_dir = join_paths(get_option('datadir'), 'dreport.d/include.d')
53dreport_plugins_dir = join_paths(get_option('datadir'), 'dreport.d/plugins.d')
54
55scripts_to_install = []
56plugins_to_install = []
57include_scripts = []
58
59subdir('tools')
60# Install collected files if any
61if scripts_to_install.length() > 0
62    install_data(scripts_to_install,
63        install_dir: get_option('bindir'),
64        install_mode: 'rwxr-xr-x'
65    )
66endif
67
68# Install collected include scripts if any
69if plugins_to_install.length() > 0
70    install_data(plugins_to_install,
71        install_dir: dreport_plugins_dir,
72        install_mode: 'rwxr-xr-x'
73    )
74endif
75
76# Install collected include scripts if any
77if include_scripts.length() > 0
78    install_data(include_scripts,
79        install_dir: dreport_include_dir,
80        install_mode: 'rwxr-xr-x'
81    )
82endif
83
84subdir('dist')
85
86