blob: 0f94b293574054413d054b2e0d0a692b8e8da87a [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,
42 input: 'phosphor-gpio-presence@.service',
43 install: true,
44 install_dir: systemd_system_unit_dir,
45 output: 'phosphor-gpio-presence@.service'
46)
Brad Bishop2d66b512019-09-19 16:36:47 -040047
48libevdev_o = static_library(
49 'libevdev_o',
50 'evdev.cpp',
51 dependencies: [
52 libevdev,
53 phosphor_dbus_interfaces,
54 phosphor_logging,
55 sdbusplus,
56 ]
57)
58
59libmonitor_o = static_library(
60 'libmonitor_o',
61 'monitor.cpp',
62 dependencies: [
63 libevdev,
64 libsystemd,
65 phosphor_logging,
66 ],
67 link_with: [
68 libevdev_o,
69 ],
70)
71
72phosphor_gpio_monitor = executable(
73 'phosphor-gpio-monitor',
74 'argument.cpp',
75 'mainapp.cpp',
76 dependencies: [
77 libevdev,
78 libsystemd,
79 phosphor_logging,
80 ],
81 install: true,
82 link_with: [
83 libevdev_o,
84 libmonitor_o,
85 ],
86)
87
Vijay Khemka939a6432019-10-09 17:45:45 -070088executable(
89 'phosphor-multi-gpio-monitor',
90 'gpioMonMain.cpp',
91 'gpioMon.cpp',
92 dependencies: [
93 phosphor_logging,
94 sdbusplus,
95 libgpiod,
96 ],
97 cpp_args: boost_args,
98 install: true,
99)
100
Brad Bishop2d66b512019-09-19 16:36:47 -0400101subdir('gpio-util')
102subdir('presence')
103subdir('test')