1# SPDX-License-Identifier: BSD-3-Clause 2# Copyright 2019 Mellanox Technologies, Ltd 3 4includes += include_directories('.') 5 6sources += files( 7 'mlx5_glue.c', 8 'mlx5_common_os.c', 9) 10 11res_lib = run_command(python3, '-c', 'import os; print(os.environ["DEVX_LIB_PATH"])') 12res_inc = run_command(python3, '-c', 'import os; print(os.environ["DEVX_INC_PATH"])') 13 14if (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() 18endif 19 20devx_lib_dir = res_lib.stdout().strip() 21devx_inc_dir = res_inc.stdout().strip() 22 23ext_deps += cc.find_library('mlx5devx', dirs: devx_lib_dir, required: true) 24includes += include_directories(devx_inc_dir) 25cflags_options = [ 26 '-std=c11', 27 '-Wno-strict-prototypes', 28 '-D_BSD_SOURCE', 29 '-D_DEFAULT_SOURCE', 30 '-D_XOPEN_SOURCE=600' 31] 32foreach option:cflags_options 33 if cc.has_argument(option) 34 cflags += option 35 endif 36endforeach 37if get_option('buildtype').contains('debug') 38 cflags += [ '-pedantic', '-DPEDANTIC' ] 39else 40 cflags += [ '-UPEDANTIC' ] 41endif 42 43# Generate an empty mlx5_autoconf.h file for compatibility with Linux 44config = configuration_data() 45configure_file(output : 'mlx5_autoconf.h', configuration : config) 46