33b506f3ac1a70bf92a3214c96aac66a1844b3b3
[dpdk.git] / lib / bpf / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
3
4 if is_windows
5     build = false
6     reason = 'not supported on Windows'
7     subdir_done()
8 endif
9
10 sources = files('bpf.c',
11         'bpf_dump.c',
12         'bpf_exec.c',
13         'bpf_load.c',
14         'bpf_pkt.c',
15         'bpf_validate.c')
16
17 if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
18     sources += files('bpf_jit_x86.c')
19 elif dpdk_conf.has('RTE_ARCH_ARM64')
20     sources += files('bpf_jit_arm64.c')
21 endif
22
23 headers = files('bpf_def.h',
24         'rte_bpf.h',
25         'rte_bpf_ethdev.h')
26
27 deps += ['mbuf', 'net', 'ethdev']
28
29 dep = dependency('libelf', required: false, method: 'pkg-config')
30 if dep.found()
31     dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1)
32     sources += files('bpf_load_elf.c')
33     ext_deps += dep
34 endif
35
36 if dpdk_conf.has('RTE_PORT_PCAP')
37     sources += files('bpf_convert.c')
38     ext_deps += pcap_dep
39 endif