Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-host-postd', |
| 3 | 'cpp', |
| 4 | default_options: [ |
| 5 | 'warning_level=3', |
| 6 | 'werror=true', |
Patrick Williams | ec799a5 | 2021-10-06 15:36:20 -0500 | [diff] [blame] | 7 | 'cpp_std=c++20' |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 8 | ], |
| 9 | license: 'Apache-2.0', |
| 10 | version: '1.0', |
Patrick Williams | 65d1753 | 2023-04-12 08:01:11 -0500 | [diff] [blame^] | 11 | meson_version: '>=0.58.0', |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 12 | ) |
| 13 | |
| 14 | build_tests = get_option('tests') |
| 15 | |
| 16 | postd_headers = include_directories('.') |
| 17 | |
| 18 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 19 | sdbusplus = dependency('sdbusplus') |
| 20 | sdeventplus = dependency('sdeventplus') |
| 21 | systemd = dependency('systemd') |
Kumar Thangavel | 0269eaf | 2021-08-11 15:45:18 +0530 | [diff] [blame] | 22 | libgpiodcxx = dependency('libgpiodcxx') |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 23 | |
| 24 | conf_data = configuration_data() |
| 25 | conf_data.set('bindir', get_option('prefix') / get_option('bindir')) |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 26 | conf_data.set('SYSTEMD_TARGET', get_option('systemd-target')) |
| 27 | |
Manojkiran Eda | aade4ad | 2021-02-19 11:20:33 +0530 | [diff] [blame] | 28 | snoopd_args = '-b ' + get_option('post-code-bytes').to_string() |
Kumar Thangavel | 0269eaf | 2021-08-11 15:45:18 +0530 | [diff] [blame] | 29 | if not get_option('snoop').disabled() |
| 30 | add_project_arguments('-DENABLE_IPMI_SNOOP',language:'cpp') |
| 31 | snoopd_args += ' -h "' + get_option('host-instances') + '"' |
| 32 | endif |
| 33 | |
Manojkiran Eda | aade4ad | 2021-02-19 11:20:33 +0530 | [diff] [blame] | 34 | if get_option('snoop-device') != '' |
| 35 | snoopd_args += ' -d /dev/' + get_option('snoop-device') |
| 36 | endif |
| 37 | conf_data.set('SNOOPD_ARGS', snoopd_args) |
| 38 | |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 39 | configure_file( |
| 40 | input: 'lpcsnoop.service.in', |
| 41 | output: 'lpcsnoop.service', |
| 42 | configuration: conf_data, |
| 43 | install: true, |
Patrick Williams | 65d1753 | 2023-04-12 08:01:11 -0500 | [diff] [blame^] | 44 | install_dir: systemd.get_variable('systemdsystemunitdir')) |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 45 | |
| 46 | executable( |
| 47 | 'snoopd', |
| 48 | 'main.cpp', |
| 49 | dependencies: [ |
| 50 | sdbusplus, |
| 51 | sdeventplus, |
| 52 | phosphor_dbus_interfaces, |
Kumar Thangavel | 0269eaf | 2021-08-11 15:45:18 +0530 | [diff] [blame] | 53 | libgpiodcxx, |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 54 | ], |
| 55 | install: true, |
| 56 | ) |
| 57 | |
| 58 | executable( |
| 59 | 'snooper', |
| 60 | 'example.cpp', |
| 61 | dependencies: [ |
| 62 | sdbusplus, |
| 63 | sdeventplus, |
| 64 | phosphor_dbus_interfaces, |
| 65 | ], |
| 66 | install: true, |
| 67 | ) |
| 68 | |
Willy Tu | 5efea6a | 2022-07-11 16:15:29 -0700 | [diff] [blame] | 69 | if not get_option('7seg').disabled() |
Patrick Williams | 65d1753 | 2023-04-12 08:01:11 -0500 | [diff] [blame^] | 70 | udevdir = dependency('udev', required : false).get_variable('udevdir') |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 71 | assert(udevdir != '', 'Cannot find udevdir') |
| 72 | install_data(['80-7seg.rules'], install_dir : udevdir) |
| 73 | |
| 74 | install_data( |
| 75 | ['postcode-7seg@.service'], |
Patrick Williams | 65d1753 | 2023-04-12 08:01:11 -0500 | [diff] [blame^] | 76 | install_dir: systemd.get_variable('systemdsystemunitdir') |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 77 | ) |
| 78 | |
| 79 | executable( |
| 80 | 'postcode_7seg', |
| 81 | '7seg.cpp', |
| 82 | dependencies: [ |
| 83 | sdbusplus, |
| 84 | phosphor_dbus_interfaces, |
| 85 | ], |
Kun Yi | 0d14a59 | 2020-04-06 14:01:36 -0700 | [diff] [blame] | 86 | install: true, |
| 87 | ) |
| 88 | endif |
| 89 | |
| 90 | install_headers( |
| 91 | 'lpcsnoop/snoop.hpp', |
| 92 | 'lpcsnoop/snoop_listen.hpp', |
| 93 | subdir: 'lpcsnoop') |
| 94 | |
| 95 | if not build_tests.disabled() |
| 96 | subdir('test') |
| 97 | endif |