net/mlx5: create flow matcher object on Windows
[dpdk.git] / drivers / common / mlx5 / windows / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright 2019 Mellanox Technologies, Ltd
3
4 includes += include_directories('.')
5
6 sources += files(
7         'mlx5_glue.c',
8         'mlx5_common_os.c',
9 )
10
11 res_lib = run_command(python3, '-c', 'import os; print(os.environ["DEVX_LIB_PATH"])')
12 res_inc = run_command(python3, '-c', 'import os; print(os.environ["DEVX_INC_PATH"])')
13
14 if (res_lib.returncode() != 0 or res_inc.returncode() != 0)
15         build = false
16         reason = 'DevX environment variables are not set, DEVX_LIB_PATH and DEVX_INC_PATH vars must be exported'
17         subdir_done()
18 endif
19
20 devx_lib_dir = res_lib.stdout().strip()
21 devx_inc_dir = res_inc.stdout().strip()
22
23 ext_deps += cc.find_library('mlx5devx', dirs: devx_lib_dir, required: true)
24 includes += include_directories(devx_inc_dir)
25 cflags_options = [
26         '-std=c11',
27         '-Wno-strict-prototypes',
28         '-D_BSD_SOURCE',
29         '-D_DEFAULT_SOURCE',
30         '-D_XOPEN_SOURCE=600'
31 ]
32 foreach option:cflags_options
33         if cc.has_argument(option)
34                 cflags += option
35         endif
36 endforeach
37 if get_option('buildtype').contains('debug')
38         cflags += [ '-pedantic', '-DPEDANTIC' ]
39 else
40         cflags += [ '-UPEDANTIC' ]
41 endif
42
43 # Generate an empty mlx5_autoconf.h file for compatibility with Linux
44 config = configuration_data()
45 configure_file(output : 'mlx5_autoconf.h', configuration : config)