blob: 9c01593b798686c955012d6fb6be78163e1b5254 [file] [log] [blame]
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -05001project(
2 'openpower-debug-collector',
3 'cpp',
Patrick Williams704170c2023-07-12 11:15:14 -05004 meson_version: '>=1.1.1',
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -05005 default_options: [
6 'warning_level=3',
7 'werror=true',
Patrick Williams704170c2023-07-12 11:15:14 -05008 'cpp_std=c++23'
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -05009 ],
10 license: 'Apache-2.0',
11 version: '1.0.0',
12)
13
Patrick Williamsdc54f512023-09-01 15:13:25 -050014cxx = meson.get_compiler('cpp')
15
Patrick Williamseebcf902022-09-13 11:20:56 -050016sdbusplus_dep = dependency('sdbusplus')
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050017
Patrick Williamsdc54f512023-09-01 15:13:25 -050018if cxx.has_header('CLI/CLI.hpp')
19 CLI11_dep = declare_dependency()
20else
21 CLI11_dep = dependency('CLI11')
22endif
23
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050024phosphorlogging = dependency(
25 'phosphor-logging',
26 fallback: [
27 'phosphor-logging',
28 'phosphor_logging_dep'
29 ]
30)
31
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050032realpath_prog = find_program('realpath')
33
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050034conf_data = configuration_data()
Patrick Williams377b35e2023-11-29 06:44:01 -060035if get_option('hostboot-dump-collection').allowed()
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050036 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 ]
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050042 subdir('watchdog')
43else
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050044 conf_data.set('WATCHDOG_DUMP_COLLECTION', false)
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050045 watchdog_lib = []
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050046 extra_deps = []
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050047endif
48
deepakala-k407e5b62023-04-24 09:15:09 -050049configure_file(output: 'config.h', configuration: conf_data)
50
Dhruvaraj Subhashchandran858d1aa2021-10-27 03:26:06 -050051if get_option('dump-collection').enabled()
52 subdir('dump')
53endif
54
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050055deps = [
Patrick Williamsdc54f512023-09-01 15:13:25 -050056 CLI11_dep,
Patrick Williamseebcf902022-09-13 11:20:56 -050057 sdbusplus_dep,
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050058 phosphorlogging,
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050059 extra_deps
60]
61
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050062executable('watchdog_timeout',
63 'watchdog_timeout.cpp',
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050064 dependencies: deps,
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050065 link_with: watchdog_lib,
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050066 implicit_include_directories: true,
67 install: true
68)
69
70executable('checkstop_app',
71 'checkstop_app.cpp',
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050072 dependencies: deps,
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050073 implicit_include_directories: true,
74 install: true
75)