1project( 2 'phosphor-host-postd', 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 15postd_headers = include_directories('.') 16 17phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') 18sdbusplus = dependency('sdbusplus') 19sdeventplus = dependency('sdeventplus') 20systemd = dependency('systemd') 21 22conf_data = configuration_data() 23conf_data.set('bindir', get_option('prefix') / get_option('bindir')) 24conf_data.set('SNOOP_DEVICE', get_option('snoop-device')) 25conf_data.set('POST_CODE_BYTES', get_option('post-code-bytes')) 26conf_data.set('SYSTEMD_TARGET', get_option('systemd-target')) 27 28configure_file( 29 input: 'lpcsnoop.service.in', 30 output: 'lpcsnoop.service', 31 configuration: conf_data, 32 install: true, 33 install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir')) 34 35executable( 36 'snoopd', 37 'main.cpp', 38 dependencies: [ 39 sdbusplus, 40 sdeventplus, 41 phosphor_dbus_interfaces, 42 ], 43 install: true, 44) 45 46executable( 47 'snooper', 48 'example.cpp', 49 dependencies: [ 50 sdbusplus, 51 sdeventplus, 52 phosphor_dbus_interfaces, 53 ], 54 install: true, 55) 56 57if get_option('7seg').enabled() 58 udevdir = dependency('udev', required : false).get_pkgconfig_variable('udevdir') 59 assert(udevdir != '', 'Cannot find udevdir') 60 install_data(['80-7seg.rules'], install_dir : udevdir) 61 62 install_data( 63 ['postcode-7seg@.service'], 64 install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir') 65 ) 66 67 executable( 68 'postcode_7seg', 69 '7seg.cpp', 70 dependencies: [ 71 sdbusplus, 72 phosphor_dbus_interfaces, 73 ], 74 link_args : [ 75 '-lstdc++fs', 76 ], 77 install: true, 78 ) 79endif 80 81install_headers( 82 'lpcsnoop/snoop.hpp', 83 'lpcsnoop/snoop_listen.hpp', 84 subdir: 'lpcsnoop') 85 86if not build_tests.disabled() 87 subdir('test') 88endif 89