xref: /dpdk/drivers/net/pcap/meson.build (revision 85cf6dc3)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2017 Intel Corporation
3
4pcap_dep = dependency('pcap', required: false)
5if pcap_dep.found()
6	build = true
7else
8	# pcap got a pkg-config file only in 1.9.0 and before that meson uses
9	# an internal pcap-config finder, which is not compatible with
10	# cross-compilation, so try to fallback to find_library
11	pcap_dep = cc.find_library('pcap', required: false)
12	if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
13		build = true
14		pkgconfig_extra_libs += '-lpcap'
15	else
16		build = false
17		reason = 'missing dependency, "libpcap"'
18	endif
19endif
20sources = files('rte_eth_pcap.c')
21ext_deps += pcap_dep
22