William A. Kennington III | 4250639 | 2021-04-22 15:19:54 -0700 | [diff] [blame] | 1 | watchdog_headers = include_directories('.') |
| 2 | |
| 3 | # CLI11 might not have a pkg-config. It is header only so just make |
| 4 | # sure we can access the needed symbols from the header. |
| 5 | cli11_dep = dependency('cli11', required: false) |
| 6 | has_cli11 = meson.get_compiler('cpp').has_header_symbol( |
| 7 | 'CLI/CLI.hpp', |
| 8 | 'CLI::App', |
| 9 | dependencies: cli11_dep, |
| 10 | required: false) |
| 11 | if not has_cli11 |
| 12 | cli11_proj = subproject('cli11', required: false) |
| 13 | assert(cli11_proj.found(), 'CLI11 is required') |
| 14 | cli11_dep = cli11_proj.get_variable('CLI11_dep') |
| 15 | endif |
| 16 | |
| 17 | watchdog_deps = [ |
| 18 | cli11_dep, |
William A. Kennington III | 86e09d7 | 2021-06-23 03:14:11 -0700 | [diff] [blame] | 19 | dependency( |
| 20 | 'phosphor-dbus-interfaces', |
| 21 | fallback: ['phosphor-dbus-interfaces', 'phosphor_dbus_interfaces_dep']), |
| 22 | dependency( |
| 23 | 'phosphor-logging', |
| 24 | fallback: ['phosphor-logging', 'phosphor_logging_dep']), |
William A. Kennington III | 4250639 | 2021-04-22 15:19:54 -0700 | [diff] [blame] | 25 | dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), |
| 26 | dependency('sdeventplus', fallback: ['sdeventplus', 'sdeventplus_dep']), |
| 27 | ] |
| 28 | |
| 29 | watchdog_lib = static_library( |
| 30 | 'watchdog', |
| 31 | 'watchdog.cpp', |
| 32 | implicit_include_directories: false, |
| 33 | include_directories: watchdog_headers, |
| 34 | dependencies: watchdog_deps) |
| 35 | |
| 36 | watchdog_dep = declare_dependency( |
| 37 | dependencies: watchdog_deps, |
| 38 | include_directories: watchdog_headers, |
| 39 | link_with: watchdog_lib) |
| 40 | |
| 41 | executable( |
| 42 | 'phosphor-watchdog', |
| 43 | 'mainapp.cpp', |
| 44 | implicit_include_directories: false, |
| 45 | dependencies: watchdog_dep, |
| 46 | install: true, |
| 47 | install_dir: get_option('bindir')) |