1a40f95c6f0ebf7bc77e91d1b27a3021a9cc11c7
[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 )
9
10 res_lib = run_command(python3, '-c', 'import os; print(os.environ["DEVX_LIB_PATH"])')
11 res_inc = run_command(python3, '-c', 'import os; print(os.environ["DEVX_INC_PATH"])')
12
13 if (res_lib.returncode() != 0 or res_inc.returncode() != 0)
14         build = false
15         reason = 'DevX environment variables are not set, DEVX_LIB_PATH and DEVX_INC_PATH vars must be exported'
16         subdir_done()
17 endif
18
19 devx_lib_dir = res_lib.stdout().strip()
20 devx_inc_dir = res_inc.stdout().strip()
21
22 ext_deps += cc.find_library('mlx5devx', dirs: devx_lib_dir, required: true)
23 includes += include_directories(devx_inc_dir)
24 cflags_options = [
25         '-std=c11',
26         '-Wno-strict-prototypes',
27         '-D_BSD_SOURCE',
28         '-D_DEFAULT_SOURCE',
29         '-D_XOPEN_SOURCE=600'
30 ]
31 foreach option:cflags_options
32         if cc.has_argument(option)
33                 cflags += option
34         endif
35 endforeach
36 if get_option('buildtype').contains('debug')
37         cflags += [ '-pedantic', '-DPEDANTIC' ]
38 else
39         cflags += [ '-UPEDANTIC' ]
40 endif