1project( 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 34fmt_dep = dependency('fmt', required: false) 35if not fmt_dep.found() 36 fmt_proj = import('cmake').subproject( 37 'fmt', 38 cmake_options: [ 39 '-DCMAKE_POSITION_INDEPENDENT_CODE=ON', 40 '-DMASTER_PROJECT=OFF' 41 ], 42 required: false) 43 assert(fmt_proj.found(), 'fmtlib is required') 44 fmt_dep = fmt_proj.dependency('fmt') 45endif 46 47realpath_prog = find_program('realpath') 48 49selected_subdirs = [] 50selected_subdirs += 'org/open_power' 51 52generated_root = meson.current_build_dir() / 'gen' 53generated_others = [] 54generated_sources = [] 55 56# Source the generated meson files 57subdir('gen') 58foreach d : selected_subdirs 59 subdir('gen' / d) 60endforeach 61 62# Parse through the list from sdbus++-gendir and put into sets. 63generated_headers = [] 64generated_cpp = [] 65generated_others_files = [] 66 67foreach g : generated_sources generated_others 68 foreach f : g.to_list() 69 rel_path = run_command( 70 realpath_prog, 71 '--relative-to', generated_root, 72 f.full_path(), 73 ).stdout().strip().split('\n')[-1] 74 75 if rel_path.endswith('.hpp') 76 generated_headers += rel_path 77 elif rel_path.endswith('.cpp') 78 generated_cpp += rel_path 79 else 80 generated_others_files += rel_path 81 endif 82 endforeach 83endforeach 84 85cxx = meson.get_compiler('cpp') 86conf_data = configuration_data() 87if get_option('hostboot-dump-collection').enabled() 88 conf_data.set('WATCHDOG_DUMP_COLLECTION', true) 89 extra_deps = [ 90 cxx.find_library('pdbg'), 91 cxx.find_library('libdt-api'), 92 cxx.find_library('phal') 93 ] 94 subdir('watchdog') 95else 96 conf_data.set('WATCHDOG_DUMP_COLLECTION', false) 97 watchdog_lib = [] 98 extra_deps = [] 99endif 100 101deps = [ 102 systemd, 103 sdbusplus, 104 phosphorlogging, 105 fmt_dep, 106 extra_deps 107] 108 109executable('watchdog_timeout', 110 'watchdog_timeout.cpp', 111 configure_file(output: 'config.h', configuration: conf_data), 112 generated_sources, 113 dependencies: deps, 114 link_with: watchdog_lib, 115 include_directories: include_directories('gen'), 116 implicit_include_directories: true, 117 install: true 118) 119 120executable('checkstop_app', 121 'checkstop_app.cpp', 122 generated_sources, 123 dependencies: deps, 124 include_directories: include_directories('gen'), 125 implicit_include_directories: true, 126 install: true 127) 128