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