net/mlx: fix library search in meson build
If MLNX_OFED is installed, there's no .pc file installed for libraries and
dependency() can't find libraries by pkg-config. By adding fallback of
using cc.find_library(), libraries are properly located.
Fixes: e30b4e566f
("build: improve dependency handling")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
This commit is contained in:
parent
0559d091cc
commit
d588f12ffb
@ -13,14 +13,17 @@ if pmd_dlopen
|
||||
'-DMLX4_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION),
|
||||
]
|
||||
endif
|
||||
libs = [
|
||||
dependency('libmnl', required:false),
|
||||
dependency('libmlx4', required:false),
|
||||
dependency('libibverbs', required:false),
|
||||
]
|
||||
libnames = [ 'mnl', 'mlx4', 'ibverbs' ]
|
||||
libs = []
|
||||
build = true
|
||||
foreach lib:libs
|
||||
foreach libname:libnames
|
||||
lib = dependency('lib' + libname, required:false)
|
||||
if not lib.found()
|
||||
lib = cc.find_library(libname, required:false)
|
||||
endif
|
||||
if lib.found()
|
||||
libs += [ lib ]
|
||||
else
|
||||
build = false
|
||||
endif
|
||||
endforeach
|
||||
|
@ -13,14 +13,17 @@ if pmd_dlopen
|
||||
'-DMLX5_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION),
|
||||
]
|
||||
endif
|
||||
libs = [
|
||||
dependency('libmnl', required:false),
|
||||
dependency('libmlx5', required:false),
|
||||
dependency('libibverbs', required:false),
|
||||
]
|
||||
libnames = [ 'mnl', 'mlx5', 'ibverbs' ]
|
||||
libs = []
|
||||
build = true
|
||||
foreach lib:libs
|
||||
foreach libname:libnames
|
||||
lib = dependency('lib' + libname, required:false)
|
||||
if not lib.found()
|
||||
lib = cc.find_library(libname, required:false)
|
||||
endif
|
||||
if lib.found()
|
||||
libs += [ lib ]
|
||||
else
|
||||
build = false
|
||||
endif
|
||||
endforeach
|
||||
|
Loading…
Reference in New Issue
Block a user