meson: skip optional linux deps that default to true when building on Windows

As 'auto' dependency checking has been declared undesirable,
skip checking of optional dependencies where the option
defaults to true, but where the option doesn't make sense for
the operating system we're building for. Example: selinux only
makes sense on Linux, people compiling on Windows or macOS
shouldn't have to specify -Dselinux=false to get glib to build.

https://bugzilla.gnome.org/show_bug.cgi?id=792129
This commit is contained in:
Tim-Philipp Müller 2017-12-25 22:17:49 +01:00
parent 7f3bfcb891
commit 7c8906dcda

View File

@ -1510,7 +1510,7 @@ xgettext = find_program('xgettext', required : false)
# libmount is only used by gio, but we need to fetch the libs to generate the
# pkg-config file below
libmount_dep = []
if get_option('libmount')
if host_system == 'linux' and get_option('libmount')
libmount_dep = [dependency('mount', version : '>=2.28', required : false)]
if not libmount_dep[0].found()
libmount_dep = [cc.find_library('mount', required : true)]
@ -1525,14 +1525,14 @@ if host_system == 'windows'
endif
selinux_dep = []
if get_option('selinux')
if host_system == 'linux' and get_option('selinux')
selinux_dep = [dependency('libselinux')]
glib_conf.set('SELINUX_LIBS', '-lselinux')
glib_conf.set('HAVE_SELINUX', 1)
endif
xattr_dep = []
if get_option('xattr')
if host_system != 'windows' and get_option('xattr')
# either glibc or libattr can provide xattr support
# for both of them, we check for getxattr being in
# the library and a valid xattr header.