blob: 60b140fe44a901fd3a240a50cdc1728fdaf77630 [file] [log] [blame]
Brad Bishop2d66b512019-09-19 16:36:47 -04001project(
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')
Vijay Khemka939a6432019-10-09 17:45:45 -070018libgpiod = dependency('libgpiod')
Brad Bishop2d66b512019-09-19 16:36:47 -040019phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
20phosphor_logging = dependency('phosphor-logging')
21sdbusplus = dependency('sdbusplus')
Brad Bishop26373ab2019-09-19 17:18:57 -040022systemd = dependency('systemd')
23
Vijay Khemka939a6432019-10-09 17:45:45 -070024boost_args = ['-DBOOST_ASIO_DISABLE_THREADS',
25 '-DBOOST_ERROR_CODE_HEADER_ONLY',
26 '-DBOOST_SYSTEM_NO_DEPRECATED']
27
Brad Bishop26373ab2019-09-19 17:18:57 -040028systemd_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,
Vijay Khemkad34bd962019-10-29 12:28:07 -070042 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,
Brad Bishop26373ab2019-09-19 17:18:57 -040050 input: 'phosphor-gpio-presence@.service',
51 install: true,
52 install_dir: systemd_system_unit_dir,
53 output: 'phosphor-gpio-presence@.service'
54)
Brad Bishop2d66b512019-09-19 16:36:47 -040055
Alvin Wang58dc2772019-11-06 13:35:13 +080056udev = dependency('udev')
57udev_rules_dir = join_paths(
58 udev.get_pkgconfig_variable(
59 'udevdir',
60 define_variable: ['prefix', get_option('prefix')],
61 ),
62 'rules.d',
63)
64
65configure_file(
66 copy: true,
67 input: '99-gpio-keys.rules',
68 install: true,
69 install_dir: udev_rules_dir,
70 output: '99-gpio-keys.rules'
71)
72
73
Vijay Khemkad34bd962019-10-29 12:28:07 -070074configure_file(
75 copy: true,
76 input: 'phosphor-multi-gpio-monitor.json',
77 install: true,
78 install_dir: '/usr/share/phosphor-gpio-monitor',
79 output: 'phosphor-multi-gpio-monitor.json'
80)
81
Brad Bishop2d66b512019-09-19 16:36:47 -040082libevdev_o = static_library(
83 'libevdev_o',
84 'evdev.cpp',
85 dependencies: [
86 libevdev,
87 phosphor_dbus_interfaces,
88 phosphor_logging,
89 sdbusplus,
90 ]
91)
92
93libmonitor_o = static_library(
94 'libmonitor_o',
95 'monitor.cpp',
96 dependencies: [
97 libevdev,
98 libsystemd,
99 phosphor_logging,
100 ],
101 link_with: [
102 libevdev_o,
103 ],
104)
105
106phosphor_gpio_monitor = executable(
107 'phosphor-gpio-monitor',
108 'argument.cpp',
109 'mainapp.cpp',
110 dependencies: [
111 libevdev,
112 libsystemd,
113 phosphor_logging,
114 ],
115 install: true,
116 link_with: [
117 libevdev_o,
118 libmonitor_o,
119 ],
120)
121
Vijay Khemka939a6432019-10-09 17:45:45 -0700122executable(
123 'phosphor-multi-gpio-monitor',
124 'gpioMonMain.cpp',
125 'gpioMon.cpp',
126 dependencies: [
127 phosphor_logging,
128 sdbusplus,
129 libgpiod,
130 ],
131 cpp_args: boost_args,
132 install: true,
133)
134
Brad Bishop2d66b512019-09-19 16:36:47 -0400135subdir('gpio-util')
136subdir('presence')
137subdir('test')