| Shantappa Teekappanavar | 222131c | 2021-06-02 10:52:56 -0500 | [diff] [blame] | 1 | project( | 
 | 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 |  | 
 | 14 | systemd = dependency('systemd', required : true) | 
 | 15 |  | 
 | 16 | sdbusplus = dependency( | 
 | 17 |     'sdbusplus', | 
 | 18 |     fallback: [ | 
 | 19 |         'sdbusplus', | 
 | 20 |         'sdbusplus_dep' | 
 | 21 |     ] | 
 | 22 | ) | 
 | 23 | sdbusplusplus_prog = find_program('sdbus++', required : true) | 
 | 24 | sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', required : true) | 
 | 25 |  | 
 | 26 | phosphorlogging = dependency( | 
 | 27 |     'phosphor-logging', | 
 | 28 |     fallback: [ | 
 | 29 |         'phosphor-logging', | 
 | 30 |         'phosphor_logging_dep' | 
 | 31 |     ] | 
 | 32 | ) | 
 | 33 |  | 
 | 34 | deps = [ | 
 | 35 |     systemd, sdbusplus, phosphorlogging | 
 | 36 | ] | 
 | 37 |  | 
 | 38 | realpath_prog = find_program('realpath') | 
 | 39 |  | 
 | 40 | selected_subdirs = [] | 
 | 41 | selected_subdirs += 'org/open_power' | 
 | 42 |  | 
 | 43 | generated_root = meson.current_build_dir() / 'gen' | 
 | 44 | generated_others = [] | 
 | 45 | generated_sources = [] | 
 | 46 |  | 
 | 47 | # Source the generated meson files | 
 | 48 | subdir('gen') | 
 | 49 | foreach d : selected_subdirs | 
 | 50 |     subdir('gen' / d) | 
 | 51 | endforeach | 
 | 52 |  | 
 | 53 | # Parse through the list from sdbus++-gendir and put into sets. | 
 | 54 | generated_headers = [] | 
 | 55 | generated_cpp = [] | 
 | 56 | generated_others_files = [] | 
 | 57 |  | 
 | 58 | foreach 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 | 
 | 74 | endforeach | 
 | 75 |  | 
 | 76 | executable('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 |  | 
 | 85 | executable('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 | ) |