xref: /dpdk/lib/vhost/meson.build (revision 4025e36fa5b7e44df07d53f8e7ddfeab5f1512a2)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2017-2018 Intel Corporation
3
4if not is_linux
5    build = false
6    reason = 'only supported on Linux'
7endif
8if has_libnuma
9    dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
10endif
11if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
12    cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
13elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
14    cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
15elif (toolchain == 'icc' and cc.version().version_compare('>=16.0.0'))
16    cflags += '-DVHOST_ICC_UNROLL_PRAGMA'
17endif
18dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
19cflags += [
20        '-fno-strict-aliasing',
21        '-Wno-address-of-packed-member',
22]
23
24sources = files(
25        'fd_man.c',
26        'iotlb.c',
27        'socket.c',
28        'vdpa.c',
29        'vhost.c',
30        'vhost_crypto.c',
31        'vhost_user.c',
32        'virtio_net.c',
33        'virtio_net_ctrl.c',
34)
35if cc.has_header('linux/vduse.h')
36    sources += files('vduse.c')
37    cflags += '-DVHOST_HAS_VDUSE'
38endif
39headers = files(
40        'rte_vdpa.h',
41        'rte_vhost.h',
42        'rte_vhost_async.h',
43        'rte_vhost_crypto.h',
44)
45driver_sdk_headers = files(
46        'vdpa_driver.h',
47)
48deps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
49