From 7c8906dcdabf30ac248e0f6838f71a3af9645aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 25 Dec 2017 22:17:49 +0100 Subject: [PATCH] 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 --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 70398921e..d99eda323 100644 --- a/meson.build +++ b/meson.build @@ -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.