1project( 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 13build_tests = get_option('tests') 14 15cppfs = meson.get_compiler('cpp').find_library('stdc++fs') 16libevdev = dependency('libevdev') 17libsystemd = dependency('libsystemd') 18libgpiod = dependency('libgpiod') 19phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') 20phosphor_logging = dependency('phosphor-logging') 21sdbusplus = dependency('sdbusplus') 22systemd = dependency('systemd') 23 24boost_args = ['-DBOOST_ASIO_DISABLE_THREADS', 25 '-DBOOST_ERROR_CODE_HEADER_ONLY', 26 '-DBOOST_SYSTEM_NO_DEPRECATED'] 27 28systemd_system_unit_dir = systemd.get_pkgconfig_variable( 29 'systemdsystemunitdir', 30 define_variable: ['prefix', get_option('prefix')]) 31 32configure_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 40configure_file( 41 copy: true, 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 48configure_file( 49 copy: true, 50 input: 'phosphor-gpio-presence@.service', 51 install: true, 52 install_dir: systemd_system_unit_dir, 53 output: 'phosphor-gpio-presence@.service' 54) 55 56configure_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 64libevdev_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 75libmonitor_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 88phosphor_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 104executable( 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 117subdir('gpio-util') 118subdir('presence') 119subdir('test') 120