blob: ae9962f9b3b1ddb0eee6872951da2fdca4ff6950 [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
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050076conf_data = configuration_data()
77if get_option('hostboot-dump-collection').enabled()
78 conf_data.set('HOSTBOOT_DUMP_COLLECTION', true)
79 subdir('watchdog')
80else
81 conf_data.set('HOSTBOOT_DUMP_COLLECTION', false)
82 watchdog_lib = []
83endif
84
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050085executable('watchdog_timeout',
86 'watchdog_timeout.cpp',
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050087 configure_file(output: 'config.h', configuration: conf_data),
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050088 generated_sources,
89 dependencies: deps,
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050090 link_with: watchdog_lib,
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050091 include_directories: include_directories('gen'),
92 implicit_include_directories: true,
93 install: true
94)
95
96executable('checkstop_app',
97 'checkstop_app.cpp',
98 generated_sources,
99 dependencies: deps,
100 include_directories: include_directories('gen'),
101 implicit_include_directories: true,
102 install: true
103)