meson: avoid compiling qemu-keymap by default
authorLaurent Vivier <laurent@vivier.eu>
Mon, 24 Aug 2020 15:24:30 +0000 (17:24 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 25 Aug 2020 06:12:19 +0000 (08:12 +0200)
qemu-keymap is not needed with linux-user, so disable it by default if
tools and system are disabled (tools are disabled by default with linux-user).

Avoid this error with statically linked binaries:

    Linking target qemu-keymap
    /usr/bin/ld: cannot find -lxkbcommon

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-id: 20200824152430.1844159-3-laurent@vivier.eu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
meson.build

index f6e346af1a696a36668a996a912f8ab3e3dc3dc5..f0fe5f8799e0d56f585bc9837d34f8c67b010878 100644 (file)
@@ -1063,6 +1063,11 @@ if 'CONFIG_GUEST_AGENT' in config_host
   subdir('qga')
 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,