blob: 9a0d49adb46f3409f9fb155a7bd3228bf85c1da4 [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 Williams65d17532023-04-12 08:01:11 -050011 meson_version: '>=0.58.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,
Patrick Williams65d17532023-04-12 08:01:11 -050044 install_dir: systemd.get_variable('systemdsystemunitdir'))
Kun Yi0d14a592020-04-06 14:01:36 -070045
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
Willy Tu5efea6a2022-07-11 16:15:29 -070069if not get_option('7seg').disabled()
Patrick Williams65d17532023-04-12 08:01:11 -050070 udevdir = dependency('udev', required : false).get_variable('udevdir')
Kun Yi0d14a592020-04-06 14:01:36 -070071 assert(udevdir != '', 'Cannot find udevdir')
72 install_data(['80-7seg.rules'], install_dir : udevdir)
73
74 install_data(
75 ['postcode-7seg@.service'],
Patrick Williams65d17532023-04-12 08:01:11 -050076 install_dir: systemd.get_variable('systemdsystemunitdir')
Kun Yi0d14a592020-04-06 14:01:36 -070077 )
78
79 executable(
80 'postcode_7seg',
81 '7seg.cpp',
82 dependencies: [
83 sdbusplus,
84 phosphor_dbus_interfaces,
85 ],
Kun Yi0d14a592020-04-06 14:01:36 -070086 install: true,
87 )
88endif
89
90install_headers(
91 'lpcsnoop/snoop.hpp',
92 'lpcsnoop/snoop_listen.hpp',
93 subdir: 'lpcsnoop')
94
95if not build_tests.disabled()
96 subdir('test')
97endif