xref: /dpdk/drivers/net/enic/meson.build (revision 4ad4b20a)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2018 Cisco Systems, Inc.
3
4if is_windows
5    build = false
6    reason = 'not supported on Windows'
7    subdir_done()
8endif
9
10sources = files(
11        'base/vnic_cq.c',
12        'base/vnic_dev.c',
13        'base/vnic_intr.c',
14        'base/vnic_rq.c',
15        'base/vnic_wq.c',
16        'enic_ethdev.c',
17        'enic_flow.c',
18        'enic_fm_flow.c',
19        'enic_main.c',
20        'enic_res.c',
21        'enic_rxtx.c',
22        'enic_vf_representor.c',
23)
24deps += ['hash']
25includes += include_directories('base')
26
27# The current implementation assumes 64-bit pointers
28if cc.get_define('__AVX2__', args: machine_args) != '' and dpdk_conf.get('RTE_ARCH_64')
29    sources += files('enic_rxtx_vec_avx2.c')
30# Build the avx2 handler if the compiler supports it, even though 'machine'
31# does not. This is to support users who build for the min supported machine
32# and need to run the binary on newer CPUs too.
33# This part is from i40e meson.build
34elif cc.has_argument('-mavx2') and dpdk_conf.get('RTE_ARCH_64')
35    enic_avx2_lib = static_library('enic_avx2_lib',
36            'enic_rxtx_vec_avx2.c',
37            dependencies: [static_rte_ethdev, static_rte_bus_pci],
38            include_directories: includes,
39            c_args: [cflags, '-mavx2'])
40    objs += enic_avx2_lib.extract_objects('enic_rxtx_vec_avx2.c')
41endif
42