tools: print the libinput version in debug-events
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 27 Nov 2019 00:55:14 +0000 (10:55 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 27 Nov 2019 05:16:30 +0000 (15:16 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
meson.build
tools/libinput-debug-events.c

index 275eaa761d1d575634aafdf0fcdb3a0c5aeab141..0e5523fef8dc161d066c6751b9c6596f5970940f 100644 (file)
@@ -482,7 +482,10 @@ man_config.set('LIBINPUT_VERSION', meson.project_version())
 man_config.set('LIBINPUT_DATA_DIR', dir_data)
 
 deps_tools = [ dep_tools_shared, dep_libinput ]
-libinput_debug_events_sources = [ 'tools/libinput-debug-events.c' ]
+libinput_debug_events_sources = [
+       'tools/libinput-debug-events.c',
+       libinput_version_h,
+]
 executable('libinput-debug-events',
           libinput_debug_events_sources,
           dependencies : deps_tools,
index 33b850f305007ad3cc68a77905c37d6c65237535..bdabb5447dc308100a8c212907b717776ef153e5 100644 (file)
@@ -38,6 +38,7 @@
 #include <libinput.h>
 #include <libevdev/libevdev.h>
 
+#include "libinput-version.h"
 #include "util-strings.h"
 #include "util-macros.h"
 #include "shared.h"
@@ -1045,6 +1046,9 @@ main(int argc, char **argv)
                return EXIT_FAILURE;
        }
 
+       if (verbose)
+               printf("libinput version: %s\n", LIBINPUT_VERSION);
+
        li = tools_open_backend(backend, seat_or_devices, verbose, &grab);
        if (!li)
                return EXIT_FAILURE;