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') |
Vijay Khemka | 939a643 | 2019-10-09 17:45:45 -0700 | [diff] [blame] | 18 | libgpiod = dependency('libgpiod') |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 19 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 20 | phosphor_logging = dependency('phosphor-logging') |
| 21 | sdbusplus = dependency('sdbusplus') |
Brad Bishop | 26373ab | 2019-09-19 17:18:57 -0400 | [diff] [blame] | 22 | systemd = dependency('systemd') |
| 23 | |
Vijay Khemka | 939a643 | 2019-10-09 17:45:45 -0700 | [diff] [blame] | 24 | boost_args = ['-DBOOST_ASIO_DISABLE_THREADS', |
| 25 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 26 | '-DBOOST_SYSTEM_NO_DEPRECATED'] |
| 27 | |
Brad Bishop | 26373ab | 2019-09-19 17:18:57 -0400 | [diff] [blame] | 28 | systemd_system_unit_dir = systemd.get_pkgconfig_variable( |
| 29 | 'systemdsystemunitdir', |
| 30 | define_variable: ['prefix', get_option('prefix')]) |
| 31 | |
| 32 | configure_file( |
| 33 | copy: true, |
| 34 | input: 'phosphor-gpio-monitor@.service', |
| 35 | install: true, |
| 36 | install_dir: systemd_system_unit_dir, |
| 37 | output: 'phosphor-gpio-monitor@.service' |
| 38 | ) |
| 39 | |
| 40 | configure_file( |
| 41 | copy: true, |
Vijay Khemka | d34bd96 | 2019-10-29 12:28:07 -0700 | [diff] [blame^] | 42 | input: 'phosphor-multi-gpio-monitor.service', |
| 43 | install: true, |
| 44 | install_dir: systemd_system_unit_dir, |
| 45 | output: 'phosphor-multi-gpio-monitor.service' |
| 46 | ) |
| 47 | |
| 48 | configure_file( |
| 49 | copy: true, |
Brad Bishop | 26373ab | 2019-09-19 17:18:57 -0400 | [diff] [blame] | 50 | input: 'phosphor-gpio-presence@.service', |
| 51 | install: true, |
| 52 | install_dir: systemd_system_unit_dir, |
| 53 | output: 'phosphor-gpio-presence@.service' |
| 54 | ) |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 55 | |
Vijay Khemka | d34bd96 | 2019-10-29 12:28:07 -0700 | [diff] [blame^] | 56 | configure_file( |
| 57 | copy: true, |
| 58 | input: 'phosphor-multi-gpio-monitor.json', |
| 59 | install: true, |
| 60 | install_dir: '/usr/share/phosphor-gpio-monitor', |
| 61 | output: 'phosphor-multi-gpio-monitor.json' |
| 62 | ) |
| 63 | |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 64 | libevdev_o = static_library( |
| 65 | 'libevdev_o', |
| 66 | 'evdev.cpp', |
| 67 | dependencies: [ |
| 68 | libevdev, |
| 69 | phosphor_dbus_interfaces, |
| 70 | phosphor_logging, |
| 71 | sdbusplus, |
| 72 | ] |
| 73 | ) |
| 74 | |
| 75 | libmonitor_o = static_library( |
| 76 | 'libmonitor_o', |
| 77 | 'monitor.cpp', |
| 78 | dependencies: [ |
| 79 | libevdev, |
| 80 | libsystemd, |
| 81 | phosphor_logging, |
| 82 | ], |
| 83 | link_with: [ |
| 84 | libevdev_o, |
| 85 | ], |
| 86 | ) |
| 87 | |
| 88 | phosphor_gpio_monitor = executable( |
| 89 | 'phosphor-gpio-monitor', |
| 90 | 'argument.cpp', |
| 91 | 'mainapp.cpp', |
| 92 | dependencies: [ |
| 93 | libevdev, |
| 94 | libsystemd, |
| 95 | phosphor_logging, |
| 96 | ], |
| 97 | install: true, |
| 98 | link_with: [ |
| 99 | libevdev_o, |
| 100 | libmonitor_o, |
| 101 | ], |
| 102 | ) |
| 103 | |
Vijay Khemka | 939a643 | 2019-10-09 17:45:45 -0700 | [diff] [blame] | 104 | executable( |
| 105 | 'phosphor-multi-gpio-monitor', |
| 106 | 'gpioMonMain.cpp', |
| 107 | 'gpioMon.cpp', |
| 108 | dependencies: [ |
| 109 | phosphor_logging, |
| 110 | sdbusplus, |
| 111 | libgpiod, |
| 112 | ], |
| 113 | cpp_args: boost_args, |
| 114 | install: true, |
| 115 | ) |
| 116 | |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 117 | subdir('gpio-util') |
| 118 | subdir('presence') |
| 119 | subdir('test') |