mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
meson: Detect XDR only when needed
If remote driver was disabled there is no need to check whether host has a XDR library installed. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/196 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a642cc648c
commit
be592a6ebb
23
meson.build
23
meson.build
@ -883,32 +883,27 @@ endforeach
|
|||||||
|
|
||||||
# early checks where lot of other packages depend on the result
|
# early checks where lot of other packages depend on the result
|
||||||
|
|
||||||
|
if not get_option('driver_remote').disabled()
|
||||||
# On MinGW portablexdr provides XDR functions, on linux they are
|
# On MinGW portablexdr provides XDR functions, on linux they are
|
||||||
# provided by libtirpc and on FreeBSD/macOS there is no need to
|
# provided by libtirpc and on FreeBSD/macOS there is no need to
|
||||||
# use extra library as it's provided by libc directly.
|
# use extra library as it's provided by libc directly.
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
xdr_dep = cc.find_library('portablexdr', required: false)
|
xdr_dep = cc.find_library('portablexdr', required: get_option('driver_remote'))
|
||||||
elif host_machine.system() == 'linux'
|
elif host_machine.system() == 'linux'
|
||||||
xdr_dep = dependency('libtirpc', required: false)
|
xdr_dep = dependency('libtirpc', required: get_option('driver_remote'))
|
||||||
elif host_machine.system() in [ 'freebsd', 'darwin' ]
|
elif host_machine.system() in [ 'freebsd', 'darwin' ]
|
||||||
xdr_dep = cc.find_library('c', required: false)
|
xdr_dep = cc.find_library('c', required: get_option('driver_remote'))
|
||||||
else
|
else
|
||||||
xdr_dep = dependency('', required: false)
|
xdr_dep = dependency('', required: false)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if not get_option('driver_remote').disabled()
|
if xdr_dep.found()
|
||||||
use_remote = true
|
conf.set('WITH_REMOTE', 1)
|
||||||
|
elif get_option('driver_remote').enabled()
|
||||||
if not xdr_dep.found()
|
|
||||||
use_remote = false
|
|
||||||
if get_option('driver_remote').enabled()
|
|
||||||
error('XDR is required for remote driver')
|
error('XDR is required for remote driver')
|
||||||
endif
|
endif
|
||||||
endif
|
else
|
||||||
|
xdr_dep = dependency('', required: false)
|
||||||
if use_remote
|
|
||||||
conf.set('WITH_REMOTE', 1)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user