blob: 8959cfbcae56a46d0187d796f6a19c63e52c8466 [file] [log] [blame]
Kun Yi0d14a592020-04-06 14:01:36 -07001project(
2 'phosphor-host-postd',
3 'cpp',
4 default_options: [
5 'warning_level=3',
6 'werror=true',
Patrick Williamsec799a52021-10-06 15:36:20 -05007 'cpp_std=c++20'
Kun Yi0d14a592020-04-06 14:01:36 -07008 ],
9 license: 'Apache-2.0',
10 version: '1.0',
Patrick Williamsec799a52021-10-06 15:36:20 -050011 meson_version: '>=0.57.0',
Kun Yi0d14a592020-04-06 14:01:36 -070012)
13
14build_tests = get_option('tests')
15
16postd_headers = include_directories('.')
17
18phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
19sdbusplus = dependency('sdbusplus')
20sdeventplus = dependency('sdeventplus')
21systemd = dependency('systemd')
Kumar Thangavel0269eaf2021-08-11 15:45:18 +053022libgpiodcxx = dependency('libgpiodcxx')
Kun Yi0d14a592020-04-06 14:01:36 -070023
24conf_data = configuration_data()
25conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
Kun Yi0d14a592020-04-06 14:01:36 -070026conf_data.set('SYSTEMD_TARGET', get_option('systemd-target'))
27
Manojkiran Edaaade4ad2021-02-19 11:20:33 +053028snoopd_args = '-b ' + get_option('post-code-bytes').to_string()
Kumar Thangavel0269eaf2021-08-11 15:45:18 +053029if not get_option('snoop').disabled()
30 add_project_arguments('-DENABLE_IPMI_SNOOP',language:'cpp')
31 snoopd_args += ' -h "' + get_option('host-instances') + '"'
32endif
33
Manojkiran Edaaade4ad2021-02-19 11:20:33 +053034if get_option('snoop-device') != ''
35 snoopd_args += ' -d /dev/' + get_option('snoop-device')
36endif
37conf_data.set('SNOOPD_ARGS', snoopd_args)
38
Kun Yi0d14a592020-04-06 14:01:36 -070039configure_file(
40 input: 'lpcsnoop.service.in',
41 output: 'lpcsnoop.service',
42 configuration: conf_data,
43 install: true,
44 install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'))
45
46executable(
47 'snoopd',
48 'main.cpp',
49 dependencies: [
50 sdbusplus,
51 sdeventplus,
52 phosphor_dbus_interfaces,
Kumar Thangavel0269eaf2021-08-11 15:45:18 +053053 libgpiodcxx,
Kun Yi0d14a592020-04-06 14:01:36 -070054 ],
55 install: true,
56)
57
58executable(
59 'snooper',
60 'example.cpp',
61 dependencies: [
62 sdbusplus,
63 sdeventplus,
64 phosphor_dbus_interfaces,
65 ],
66 install: true,
67)
68
69if get_option('7seg').enabled()
70 udevdir = dependency('udev', required : false).get_pkgconfig_variable('udevdir')
71 assert(udevdir != '', 'Cannot find udevdir')
72 install_data(['80-7seg.rules'], install_dir : udevdir)
73
74 install_data(
75 ['postcode-7seg@.service'],
76 install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir')
77 )
78
79 executable(
80 'postcode_7seg',
81 '7seg.cpp',
82 dependencies: [
83 sdbusplus,
84 phosphor_dbus_interfaces,
85 ],
86 link_args : [
87 '-lstdc++fs',
88 ],
89 install: true,
90 )
91endif
92
93install_headers(
94 'lpcsnoop/snoop.hpp',
95 'lpcsnoop/snoop_listen.hpp',
96 subdir: 'lpcsnoop')
97
98if not build_tests.disabled()
99 subdir('test')
100endif