blob: 099687806953cb0c07520485c64bcd761393ee7c [file] [log] [blame]
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -05001project(
2 'openpower-debug-collector',
3 'cpp',
4 meson_version: '>= 0.57.0',
5 default_options: [
6 'warning_level=3',
7 'werror=true',
8 'cpp_std=c++20'
9 ],
10 license: 'Apache-2.0',
11 version: '1.0.0',
12)
13
14systemd = dependency('systemd', required : true)
15
16sdbusplus = dependency(
17 'sdbusplus',
18 fallback: [
19 'sdbusplus',
20 'sdbusplus_dep'
21 ]
22)
23sdbusplusplus_prog = find_program('sdbus++', required : true)
24sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', required : true)
25
26phosphorlogging = dependency(
27 'phosphor-logging',
28 fallback: [
29 'phosphor-logging',
30 'phosphor_logging_dep'
31 ]
32)
33
34deps = [
35 systemd, sdbusplus, phosphorlogging
36]
37
38realpath_prog = find_program('realpath')
39
40selected_subdirs = []
41selected_subdirs += 'org/open_power'
42
43generated_root = meson.current_build_dir() / 'gen'
44generated_others = []
45generated_sources = []
46
47# Source the generated meson files
48subdir('gen')
49foreach d : selected_subdirs
50 subdir('gen' / d)
51endforeach
52
53# Parse through the list from sdbus++-gendir and put into sets.
54generated_headers = []
55generated_cpp = []
56generated_others_files = []
57
58foreach g : generated_sources generated_others
59 foreach f : g.to_list()
60 rel_path = run_command(
61 realpath_prog,
62 '--relative-to', generated_root,
63 f.full_path(),
64 ).stdout().strip().split('\n')[-1]
65
66 if rel_path.endswith('.hpp')
67 generated_headers += rel_path
68 elif rel_path.endswith('.cpp')
69 generated_cpp += rel_path
70 else
71 generated_others_files += rel_path
72 endif
73 endforeach
74endforeach
75
76executable('watchdog_timeout',
77 'watchdog_timeout.cpp',
78 generated_sources,
79 dependencies: deps,
80 include_directories: include_directories('gen'),
81 implicit_include_directories: true,
82 install: true
83)
84
85executable('checkstop_app',
86 'checkstop_app.cpp',
87 generated_sources,
88 dependencies: deps,
89 include_directories: include_directories('gen'),
90 implicit_include_directories: true,
91 install: true
92)