William A. Kennington III | 0b3c389 | 2021-04-20 16:00:55 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-watchdog', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
William A. Kennington III | a8f5911 | 2021-04-20 16:21:25 -0700 | [diff] [blame^] | 5 | meson_version: '>=0.55.0', |
William A. Kennington III | 0b3c389 | 2021-04-20 16:00:55 -0700 | [diff] [blame] | 6 | default_options: [ |
| 7 | 'warning_level=3', |
William A. Kennington III | 0b3c389 | 2021-04-20 16:00:55 -0700 | [diff] [blame] | 8 | 'cpp_std=c++17', |
| 9 | ]) |
William A. Kennington III | b933771 | 2019-01-15 18:27:13 -0800 | [diff] [blame] | 10 | |
William A. Kennington III | 080ffd7 | 2021-04-20 16:45:24 -0700 | [diff] [blame] | 11 | watchdog_headers = include_directories('.') |
William A. Kennington III | b933771 | 2019-01-15 18:27:13 -0800 | [diff] [blame] | 12 | |
William A. Kennington III | 080ffd7 | 2021-04-20 16:45:24 -0700 | [diff] [blame] | 13 | watchdog_deps = [ |
| 14 | dependency('phosphor-dbus-interfaces'), |
| 15 | dependency('phosphor-logging'), |
William A. Kennington III | a8f5911 | 2021-04-20 16:21:25 -0700 | [diff] [blame^] | 16 | dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), |
| 17 | dependency('sdeventplus', fallback: ['sdeventplus', 'sdeventplus_dep']), |
William A. Kennington III | 080ffd7 | 2021-04-20 16:45:24 -0700 | [diff] [blame] | 18 | ] |
| 19 | |
| 20 | watchdog_lib = static_library( |
William A. Kennington III | b933771 | 2019-01-15 18:27:13 -0800 | [diff] [blame] | 21 | 'watchdog', |
| 22 | 'watchdog.cpp', |
| 23 | implicit_include_directories: false, |
William A. Kennington III | 080ffd7 | 2021-04-20 16:45:24 -0700 | [diff] [blame] | 24 | include_directories: watchdog_headers, |
| 25 | dependencies: watchdog_deps) |
| 26 | |
| 27 | watchdog_dep = declare_dependency( |
| 28 | dependencies: watchdog_deps, |
| 29 | include_directories: watchdog_headers, |
| 30 | link_with: watchdog_lib) |
William A. Kennington III | b933771 | 2019-01-15 18:27:13 -0800 | [diff] [blame] | 31 | |
| 32 | executable( |
| 33 | 'phosphor-watchdog', |
| 34 | 'mainapp.cpp', |
| 35 | implicit_include_directories: false, |
William A. Kennington III | 080ffd7 | 2021-04-20 16:45:24 -0700 | [diff] [blame] | 36 | dependencies: watchdog_dep, |
William A. Kennington III | b933771 | 2019-01-15 18:27:13 -0800 | [diff] [blame] | 37 | install: true, |
Patrick Venture | 8c8072a | 2019-03-28 10:50:21 -0700 | [diff] [blame] | 38 | install_dir: get_option('bindir')) |
William A. Kennington III | b933771 | 2019-01-15 18:27:13 -0800 | [diff] [blame] | 39 | |
William A. Kennington III | 0b3c389 | 2021-04-20 16:00:55 -0700 | [diff] [blame] | 40 | if not get_option('tests').disabled() |
William A. Kennington III | b933771 | 2019-01-15 18:27:13 -0800 | [diff] [blame] | 41 | subdir('test') |
| 42 | endif |