1f0a0a3bbSTal Shnaiderman# SPDX-License-Identifier: BSD-3-Clause 2f0a0a3bbSTal Shnaiderman# Copyright 2019 Mellanox Technologies, Ltd 3f0a0a3bbSTal Shnaiderman 4*85c51a4fSThomas Monjalonif not cc.has_header('mlx5devx.h') 5*85c51a4fSThomas Monjalon build = false 6*85c51a4fSThomas Monjalon reason = 'missing dependency, "mlx5devx.h"' 7*85c51a4fSThomas Monjalon subdir_done() 8*85c51a4fSThomas Monjalonendif 9*85c51a4fSThomas Monjalon 10*85c51a4fSThomas Monjalondevxlib = cc.find_library('mlx5devx', required: true) 11*85c51a4fSThomas Monjalonif not devxlib.found() 12*85c51a4fSThomas Monjalon build = false 13*85c51a4fSThomas Monjalon reason = 'missing dependency, "mlx5devx"' 14*85c51a4fSThomas Monjalon subdir_done() 15*85c51a4fSThomas Monjalonendif 16*85c51a4fSThomas Monjalonext_deps += devxlib 17*85c51a4fSThomas Monjalon 18f0a0a3bbSTal Shnaidermanincludes += include_directories('.') 19f0a0a3bbSTal Shnaiderman 20f0a0a3bbSTal Shnaidermansources += files( 21f0a0a3bbSTal Shnaiderman 'mlx5_glue.c', 22e11fe027SOphir Munk 'mlx5_common_os.c', 23f0a0a3bbSTal Shnaiderman) 24f0a0a3bbSTal Shnaiderman 25f0a0a3bbSTal Shnaidermancflags_options = [ 26f0a0a3bbSTal Shnaiderman '-std=c11', 27f0a0a3bbSTal Shnaiderman '-Wno-strict-prototypes', 28f0a0a3bbSTal Shnaiderman '-D_BSD_SOURCE', 29f0a0a3bbSTal Shnaiderman '-D_DEFAULT_SOURCE', 304ad4b20aSBruce Richardson '-D_XOPEN_SOURCE=600', 31f0a0a3bbSTal Shnaiderman] 32f0a0a3bbSTal Shnaidermanforeach option:cflags_options 33f0a0a3bbSTal Shnaiderman if cc.has_argument(option) 34f0a0a3bbSTal Shnaiderman cflags += option 35f0a0a3bbSTal Shnaiderman endif 36f0a0a3bbSTal Shnaidermanendforeach 37f0a0a3bbSTal Shnaidermanif get_option('buildtype').contains('debug') 38f0a0a3bbSTal Shnaiderman cflags += [ '-pedantic', '-DPEDANTIC' ] 39f0a0a3bbSTal Shnaidermanelse 40f0a0a3bbSTal Shnaiderman cflags += [ '-UPEDANTIC' ] 41f0a0a3bbSTal Shnaidermanendif 42