net/ice/base: fix build with GCC 12
[dpdk.git] / drivers / net / ice / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
3
4 subdir('base')
5 objs = [base_objs]
6
7 sources = files(
8         'ice_acl_filter.c',
9         'ice_ddp_package.c',
10         'ice_ethdev.c',
11         'ice_fdir_filter.c',
12         'ice_generic_flow.c',
13         'ice_hash.c',
14         'ice_rxtx.c',
15         'ice_switch_filter.c',
16         'ice_tm.c',
17 )
18
19 testpmd_sources = files('ice_testpmd.c')
20
21 deps += ['hash', 'net', 'common_iavf']
22 includes += include_directories('base', '../../common/iavf')
23
24 if arch_subdir == 'x86'
25     sources += files('ice_rxtx_vec_sse.c')
26
27     if is_windows and cc.get_id() != 'clang'
28         cflags += ['-fno-asynchronous-unwind-tables']
29     endif
30
31     # compile AVX2 version if either:
32     # a. we have AVX supported in minimum instruction set baseline
33     # b. it's not minimum instruction set, but supported by compiler
34     if cc.get_define('__AVX2__', args: machine_args) != ''
35         cflags += ['-DCC_AVX2_SUPPORT']
36         sources += files('ice_rxtx_vec_avx2.c')
37     elif cc.has_argument('-mavx2')
38         cflags += ['-DCC_AVX2_SUPPORT']
39         ice_avx2_lib = static_library('ice_avx2_lib',
40                 'ice_rxtx_vec_avx2.c',
41                 dependencies: [static_rte_ethdev, static_rte_kvargs, static_rte_hash],
42                 include_directories: includes,
43                 c_args: [cflags, '-mavx2'])
44         objs += ice_avx2_lib.extract_objects('ice_rxtx_vec_avx2.c')
45     endif
46
47     ice_avx512_cpu_support = (
48             cc.get_define('__AVX512F__', args: machine_args) != '' and
49                 cc.get_define('__AVX512BW__', args: machine_args) != ''
50     )
51
52     ice_avx512_cc_support = (
53             not machine_args.contains('-mno-avx512f') and
54                 cc.has_argument('-mavx512f') and
55                 cc.has_argument('-mavx512bw')
56     )
57
58     if ice_avx512_cpu_support == true or ice_avx512_cc_support == true
59         cflags += ['-DCC_AVX512_SUPPORT']
60         avx512_args = [cflags, '-mavx512f', '-mavx512bw']
61         if cc.has_argument('-march=skylake-avx512')
62             avx512_args += '-march=skylake-avx512'
63         endif
64         ice_avx512_lib = static_library('ice_avx512_lib',
65                 'ice_rxtx_vec_avx512.c',
66                 dependencies: [static_rte_ethdev,
67                     static_rte_kvargs, static_rte_hash],
68                 include_directories: includes,
69                 c_args: avx512_args)
70         objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c')
71     endif
72 endif
73
74 sources += files(
75         'ice_dcf.c',
76         'ice_dcf_vf_representor.c',
77         'ice_dcf_ethdev.c',
78         'ice_dcf_parent.c',
79         'ice_dcf_sched.c',
80 )
81
82 headers = files('rte_pmd_ice.h')