diff mbox series

[libdrm] modtest: print libdrm version

Message ID 20240708093508.3908098-1-andyshrk@163.com (mailing list archive)
State New, archived
Headers show
Series [libdrm] modtest: print libdrm version | expand

Commit Message

Andy Yan July 8, 2024, 9:35 a.m. UTC
From: Andy Yan <andyshrk@gmail.com>

Signed-off-by: Andy Yan <andyshrk@gmail.com>
---
 meson.build               | 1 +
 tests/modetest/modetest.c | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 8fd0a196..fab61e09 100644
--- a/meson.build
+++ b/meson.build
@@ -45,6 +45,7 @@  dep_threads = dependency('threads')
 cc = meson.get_compiler('c')
 
 android = cc.compiles('''int func() { return __ANDROID__; }''')
+add_global_arguments('-DLIBDRM_VERSION="@0@"'.format(meson.project_version()), language : 'c')
 
 # Solaris / Illumos
 if host_machine.system() == 'sunos'
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index d9e761e6..8cfc7e08 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -2129,6 +2129,7 @@  static void parse_fill_patterns(char *arg)
 static void usage(char *name)
 {
 	fprintf(stderr, "usage: %s [-acDdefMoPpsCvrw]\n", name);
+	fprintf(stderr, "libdrm version: %s\n", LIBDRM_VERSION);
 
 	fprintf(stderr, "\n Query options:\n\n");
 	fprintf(stderr, "\t-c\tlist connectors\n");