blob: 578625e3e14829e041aabd807c1705e0d006b750 [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
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050016systemd = dependency('systemd', required : true)
17
Patrick Williamseebcf902022-09-13 11:20:56 -050018sdbusplus_dep = dependency('sdbusplus')
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050019
Patrick Williamsdc54f512023-09-01 15:13:25 -050020if cxx.has_header('CLI/CLI.hpp')
21 CLI11_dep = declare_dependency()
22else
23 CLI11_dep = dependency('CLI11')
24endif
25
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050026phosphorlogging = dependency(
27 'phosphor-logging',
28 fallback: [
29 'phosphor-logging',
30 'phosphor_logging_dep'
31 ]
32)
33
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050034realpath_prog = find_program('realpath')
35
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050036conf_data = configuration_data()
37if get_option('hostboot-dump-collection').enabled()
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050038 conf_data.set('WATCHDOG_DUMP_COLLECTION', true)
39 extra_deps = [
40 cxx.find_library('pdbg'),
41 cxx.find_library('libdt-api'),
42 cxx.find_library('phal')
43 ]
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050044 subdir('watchdog')
45else
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050046 conf_data.set('WATCHDOG_DUMP_COLLECTION', false)
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050047 watchdog_lib = []
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050048 extra_deps = []
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050049endif
50
deepakala-k407e5b62023-04-24 09:15:09 -050051configure_file(output: 'config.h', configuration: conf_data)
52
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050053deps = [
54 systemd,
Patrick Williamsdc54f512023-09-01 15:13:25 -050055 CLI11_dep,
Patrick Williamseebcf902022-09-13 11:20:56 -050056 sdbusplus_dep,
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050057 phosphorlogging,
Shantappa Teekappanavar41d507e2021-10-05 12:17:55 -050058 extra_deps
59]
60
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050061executable('watchdog_timeout',
62 'watchdog_timeout.cpp',
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050063 dependencies: deps,
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -050064 link_with: watchdog_lib,
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050065 implicit_include_directories: true,
66 install: true
67)
68
69executable('checkstop_app',
70 'checkstop_app.cpp',
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050071 dependencies: deps,
Shantappa Teekappanavar222131c2021-06-02 10:52:56 -050072 implicit_include_directories: true,
73 install: true
74)