Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-gpio-monitor', |
| 3 | 'cpp', |
| 4 | default_options: [ |
| 5 | 'warning_level=3', |
| 6 | 'werror=true', |
| 7 | 'cpp_std=c++17' |
| 8 | ], |
| 9 | license: 'Apache-2.0', |
| 10 | version: '1.0', |
| 11 | ) |
| 12 | |
| 13 | build_tests = get_option('tests') |
| 14 | |
| 15 | cppfs = meson.get_compiler('cpp').find_library('stdc++fs') |
| 16 | libevdev = dependency('libevdev') |
| 17 | libsystemd = dependency('libsystemd') |
| 18 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 19 | phosphor_logging = dependency('phosphor-logging') |
| 20 | sdbusplus = dependency('sdbusplus') |
Brad Bishop | 26373ab | 2019-09-19 17:18:57 -0400 | [diff] [blame^] | 21 | systemd = dependency('systemd') |
| 22 | |
| 23 | systemd_system_unit_dir = systemd.get_pkgconfig_variable( |
| 24 | 'systemdsystemunitdir', |
| 25 | define_variable: ['prefix', get_option('prefix')]) |
| 26 | |
| 27 | configure_file( |
| 28 | copy: true, |
| 29 | input: 'phosphor-gpio-monitor@.service', |
| 30 | install: true, |
| 31 | install_dir: systemd_system_unit_dir, |
| 32 | output: 'phosphor-gpio-monitor@.service' |
| 33 | ) |
| 34 | |
| 35 | configure_file( |
| 36 | copy: true, |
| 37 | input: 'phosphor-gpio-presence@.service', |
| 38 | install: true, |
| 39 | install_dir: systemd_system_unit_dir, |
| 40 | output: 'phosphor-gpio-presence@.service' |
| 41 | ) |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 42 | |
| 43 | libevdev_o = static_library( |
| 44 | 'libevdev_o', |
| 45 | 'evdev.cpp', |
| 46 | dependencies: [ |
| 47 | libevdev, |
| 48 | phosphor_dbus_interfaces, |
| 49 | phosphor_logging, |
| 50 | sdbusplus, |
| 51 | ] |
| 52 | ) |
| 53 | |
| 54 | libmonitor_o = static_library( |
| 55 | 'libmonitor_o', |
| 56 | 'monitor.cpp', |
| 57 | dependencies: [ |
| 58 | libevdev, |
| 59 | libsystemd, |
| 60 | phosphor_logging, |
| 61 | ], |
| 62 | link_with: [ |
| 63 | libevdev_o, |
| 64 | ], |
| 65 | ) |
| 66 | |
| 67 | phosphor_gpio_monitor = executable( |
| 68 | 'phosphor-gpio-monitor', |
| 69 | 'argument.cpp', |
| 70 | 'mainapp.cpp', |
| 71 | dependencies: [ |
| 72 | libevdev, |
| 73 | libsystemd, |
| 74 | phosphor_logging, |
| 75 | ], |
| 76 | install: true, |
| 77 | link_with: [ |
| 78 | libevdev_o, |
| 79 | libmonitor_o, |
| 80 | ], |
| 81 | ) |
| 82 | |
| 83 | subdir('gpio-util') |
| 84 | subdir('presence') |
| 85 | subdir('test') |