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', |
Brandon Wyman | ca2637e | 2021-03-04 12:41:21 -0600 | [diff] [blame] | 7 | 'cpp_std=c++17', |
| 8 | 'buildtype=debugoptimized' |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 9 | ], |
| 10 | license: 'Apache-2.0', |
| 11 | version: '1.0', |
| 12 | ) |
| 13 | |
| 14 | build_tests = get_option('tests') |
| 15 | |
| 16 | cppfs = meson.get_compiler('cpp').find_library('stdc++fs') |
| 17 | libevdev = dependency('libevdev') |
| 18 | libsystemd = dependency('libsystemd') |
Vijay Khemka | 939a643 | 2019-10-09 17:45:45 -0700 | [diff] [blame] | 19 | libgpiod = dependency('libgpiod') |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 20 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 21 | phosphor_logging = dependency('phosphor-logging') |
| 22 | sdbusplus = dependency('sdbusplus') |
Brad Bishop | 26373ab | 2019-09-19 17:18:57 -0400 | [diff] [blame] | 23 | systemd = dependency('systemd') |
| 24 | |
Vijay Khemka | 939a643 | 2019-10-09 17:45:45 -0700 | [diff] [blame] | 25 | boost_args = ['-DBOOST_ASIO_DISABLE_THREADS', |
| 26 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 27 | '-DBOOST_SYSTEM_NO_DEPRECATED'] |
| 28 | |
Brad Bishop | 26373ab | 2019-09-19 17:18:57 -0400 | [diff] [blame] | 29 | systemd_system_unit_dir = systemd.get_pkgconfig_variable( |
| 30 | 'systemdsystemunitdir', |
| 31 | define_variable: ['prefix', get_option('prefix')]) |
| 32 | |
| 33 | configure_file( |
| 34 | copy: true, |
| 35 | input: 'phosphor-gpio-monitor@.service', |
| 36 | install: true, |
| 37 | install_dir: systemd_system_unit_dir, |
| 38 | output: 'phosphor-gpio-monitor@.service' |
| 39 | ) |
| 40 | |
| 41 | configure_file( |
| 42 | copy: true, |
Vijay Khemka | d34bd96 | 2019-10-29 12:28:07 -0700 | [diff] [blame] | 43 | input: 'phosphor-multi-gpio-monitor.service', |
| 44 | install: true, |
| 45 | install_dir: systemd_system_unit_dir, |
| 46 | output: 'phosphor-multi-gpio-monitor.service' |
| 47 | ) |
| 48 | |
| 49 | configure_file( |
| 50 | copy: true, |
Brad Bishop | 26373ab | 2019-09-19 17:18:57 -0400 | [diff] [blame] | 51 | input: 'phosphor-gpio-presence@.service', |
| 52 | install: true, |
| 53 | install_dir: systemd_system_unit_dir, |
| 54 | output: 'phosphor-gpio-presence@.service' |
| 55 | ) |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 56 | |
Alvin Wang | 58dc277 | 2019-11-06 13:35:13 +0800 | [diff] [blame] | 57 | udev = dependency('udev') |
| 58 | udev_rules_dir = join_paths( |
| 59 | udev.get_pkgconfig_variable( |
| 60 | 'udevdir', |
| 61 | define_variable: ['prefix', get_option('prefix')], |
| 62 | ), |
| 63 | 'rules.d', |
| 64 | ) |
| 65 | |
| 66 | configure_file( |
| 67 | copy: true, |
| 68 | input: '99-gpio-keys.rules', |
| 69 | install: true, |
| 70 | install_dir: udev_rules_dir, |
| 71 | output: '99-gpio-keys.rules' |
| 72 | ) |
| 73 | |
| 74 | |
Vijay Khemka | d34bd96 | 2019-10-29 12:28:07 -0700 | [diff] [blame] | 75 | configure_file( |
| 76 | copy: true, |
| 77 | input: 'phosphor-multi-gpio-monitor.json', |
| 78 | install: true, |
| 79 | install_dir: '/usr/share/phosphor-gpio-monitor', |
| 80 | output: 'phosphor-multi-gpio-monitor.json' |
| 81 | ) |
| 82 | |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 83 | libevdev_o = static_library( |
| 84 | 'libevdev_o', |
| 85 | 'evdev.cpp', |
| 86 | dependencies: [ |
| 87 | libevdev, |
| 88 | phosphor_dbus_interfaces, |
| 89 | phosphor_logging, |
| 90 | sdbusplus, |
| 91 | ] |
| 92 | ) |
| 93 | |
| 94 | libmonitor_o = static_library( |
| 95 | 'libmonitor_o', |
| 96 | 'monitor.cpp', |
| 97 | dependencies: [ |
| 98 | libevdev, |
| 99 | libsystemd, |
| 100 | phosphor_logging, |
| 101 | ], |
| 102 | link_with: [ |
| 103 | libevdev_o, |
| 104 | ], |
| 105 | ) |
| 106 | |
| 107 | phosphor_gpio_monitor = executable( |
| 108 | 'phosphor-gpio-monitor', |
| 109 | 'argument.cpp', |
| 110 | 'mainapp.cpp', |
| 111 | dependencies: [ |
| 112 | libevdev, |
| 113 | libsystemd, |
| 114 | phosphor_logging, |
| 115 | ], |
| 116 | install: true, |
| 117 | link_with: [ |
| 118 | libevdev_o, |
| 119 | libmonitor_o, |
| 120 | ], |
| 121 | ) |
| 122 | |
Vijay Khemka | 939a643 | 2019-10-09 17:45:45 -0700 | [diff] [blame] | 123 | executable( |
| 124 | 'phosphor-multi-gpio-monitor', |
| 125 | 'gpioMonMain.cpp', |
| 126 | 'gpioMon.cpp', |
| 127 | dependencies: [ |
| 128 | phosphor_logging, |
| 129 | sdbusplus, |
| 130 | libgpiod, |
| 131 | ], |
| 132 | cpp_args: boost_args, |
| 133 | install: true, |
| 134 | ) |
| 135 | |
Brad Bishop | 2d66b51 | 2019-09-19 16:36:47 -0400 | [diff] [blame] | 136 | subdir('gpio-util') |
| 137 | subdir('presence') |
| 138 | subdir('test') |