mirror of https://github.com/xemu-project/xemu.git
meson: extend libmpathpersist test for static linking
libmultipath has a dependency on libdevmapper, so include it as well when static linking. It seems that the rabbit hole ends there. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6ec0e15d95
commit
43b43a4027
19
meson.build
19
meson.build
|
@ -302,14 +302,25 @@ if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
|
||||||
mpath_lib_init(udev);
|
mpath_lib_init(udev);
|
||||||
return 0;
|
return 0;
|
||||||
}'''
|
}'''
|
||||||
libmultipath = cc.find_library('multipath',
|
mpathlibs = [libudev]
|
||||||
|
if enable_static
|
||||||
|
mpathlibs += cc.find_library('devmapper',
|
||||||
required: get_option('mpath'),
|
required: get_option('mpath'),
|
||||||
static: enable_static)
|
static: enable_static)
|
||||||
libmpathpersist = cc.find_library('mpathpersist',
|
endif
|
||||||
|
mpathlibs += cc.find_library('multipath',
|
||||||
required: get_option('mpath'),
|
required: get_option('mpath'),
|
||||||
static: enable_static)
|
static: enable_static)
|
||||||
if libmultipath.found() and libmpathpersist.found() and libudev.found()
|
mpathlibs += cc.find_library('mpathpersist',
|
||||||
mpathlibs = [libmultipath, libmpathpersist, libudev]
|
required: get_option('mpath'),
|
||||||
|
static: enable_static)
|
||||||
|
foreach lib: mpathlibs
|
||||||
|
if not lib.found()
|
||||||
|
mpathlibs = []
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
if mpathlibs.length() > 0
|
||||||
if cc.links(mpath_test_source_new, dependencies: mpathlibs)
|
if cc.links(mpath_test_source_new, dependencies: mpathlibs)
|
||||||
mpathpersist = declare_dependency(dependencies: mpathlibs)
|
mpathpersist = declare_dependency(dependencies: mpathlibs)
|
||||||
mpathpersist_new_api = true
|
mpathpersist_new_api = true
|
||||||
|
|
Loading…
Reference in New Issue