meson: cleanup xkbcommon detection
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Aug 2020 07:24:11 +0000 (03:24 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 Aug 2020 16:52:30 +0000 (18:52 +0200)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
meson.build

index a3baa2dbf04f34f17507d0ab90af4f7cc125c33b..90128616e5f639842398cd9169d9fe5e4792146c 100644 (file)
@@ -165,10 +165,11 @@ libcap_ng = not_found
 if 'CONFIG_LIBCAP_NG' in config_host
   libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split())
 endif
-xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'), static: enable_static,
-                       include_type: 'system')
-if xkbcommon.found()
-  xkbcommon = declare_dependency(dependencies: xkbcommon)
+if get_option('xkbcommon').auto() and not have_system and not have_tools
+  xkbcommon = not_found
+else
+  xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
+                         static: enable_static)
 endif
 slirp = not_found
 if config_host.has_key('CONFIG_SLIRP')
@@ -1078,9 +1079,6 @@ endif
 
 # Don't build qemu-keymap if xkbcommon is not explicitly enabled
 # when we don't build tools or system
-if get_option('xkbcommon').auto() and not have_system and not have_tools
-  xkbcommon = not_found
-endif
 if xkbcommon.found()
   # used for the update-keymaps target, so include rules even if !have_tools
   qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,