blob: b5e6529825d001ff61fe61b69470601a3deda663 [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
Vijay Khemkad34bd962019-10-29 12:28:07 -070056configure_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 Bishop2d66b512019-09-19 16:36:47 -040064libevdev_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
Vijay Khemka939a6432019-10-09 17:45:45 -0700104executable(
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 Bishop2d66b512019-09-19 16:36:47 -0400117subdir('gpio-util')
118subdir('presence')
119subdir('test')