net/bnxt: support Thor platform
[dpdk.git] / drivers / net / bnxt / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
3 # Copyright(c) 2020 Broadcom
4
5 if is_windows
6     build = false
7     reason = 'not supported on Windows'
8     subdir_done()
9 endif
10
11 headers = files('rte_pmd_bnxt.h')
12 cflags_options = [
13         '-DRTE_LIBRTE_BNXT_TF',
14         '-DSUPPORT_CFA_HW_ALL=1',
15 ]
16
17 foreach option:cflags_options
18         if cc.has_argument(option)
19                 cflags += option
20         endif
21 endforeach
22
23 headers = files('rte_pmd_bnxt.h')
24
25 sources = files(
26         'bnxt_cpr.c',
27         'bnxt_ethdev.c',
28         'bnxt_filter.c',
29         'bnxt_flow.c',
30         'bnxt_hwrm.c',
31         'bnxt_irq.c',
32         'bnxt_ring.c',
33         'bnxt_rxq.c',
34         'bnxt_rxr.c',
35         'bnxt_stats.c',
36         'bnxt_txq.c',
37         'bnxt_txr.c',
38         'bnxt_util.c',
39         'bnxt_vnic.c',
40         'bnxt_reps.c',
41
42         'rte_pmd_bnxt.c',
43 )
44
45 #Add the subdirectories that need to be compiled
46 subdir('tf_ulp')
47 subdir('tf_core')
48 subdir('hcapi/cfa')
49
50 if arch_subdir == 'x86'
51     sources += files('bnxt_rxtx_vec_sse.c')
52     # compile AVX2 version if either:
53     # a. we have AVX supported in minimum instruction set baseline
54     # b. it's not minimum instruction set, but supported by compiler
55     if cc.get_define('__AVX2__', args: machine_args) != ''
56             cflags += ['-DCC_AVX2_SUPPORT']
57             sources += files('bnxt_rxtx_vec_avx2.c')
58     elif cc.has_argument('-mavx2')
59             cflags += ['-DCC_AVX2_SUPPORT']
60             bnxt_avx2_lib = static_library('bnxt_avx2_lib',
61                             'bnxt_rxtx_vec_avx2.c',
62                             dependencies: [static_rte_ethdev,
63                                     static_rte_bus_pci,
64                                     static_rte_kvargs, static_rte_hash],
65                             include_directories: includes,
66                             c_args: [cflags, '-mavx2'])
67             objs += bnxt_avx2_lib.extract_objects('bnxt_rxtx_vec_avx2.c')
68      endif
69 elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64')
70     sources += files('bnxt_rxtx_vec_neon.c')
71 endif