summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-04-04 13:43:15 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-04-04 16:02:09 +1000
commit72b86caffcb05ed03e6467801fc19d8af81e6f4f (patch)
tree4a6cf9616ac28f2f34381eddf961f433e9746eb7
parent05eaa8c81352dffd7b7dba7d73cad23a72db03ee (diff)
downloadlibwacom-72b86caffcb05ed03e6467801fc19d8af81e6f4f.tar.gz
tools: add list-local-devices as builddir tool
An uninstalled version of libwacom-list-local-devices that does not require the database path to be given on the commandline. Makes things a bit more convenient for debugging, same as the existing builddir/list-devices.
-rw-r--r--meson.build10
-rw-r--r--tools/list-local-devices.c4
2 files changed, 13 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index d5d4d9e..a374215 100644
--- a/meson.build
+++ b/meson.build
@@ -136,13 +136,21 @@ endif
############### tools ###########################
+tools_cflags = ['-DDATABASEPATH="@0@"'.format(dir_src_data)]
+
executable('libwacom-list-local-devices',
'tools/list-local-devices.c',
dependencies: [dep_libwacom, dep_glib, dep_gudev],
include_directories: [includes_src],
install: true)
-tools_cflags = ['-DDATABASEPATH="@0@"'.format(dir_src_data)]
+# The non-installed version of list-local-devices uses the git tree's data files
+executable('list-local-devices',
+ 'tools/list-local-devices.c',
+ dependencies: [dep_libwacom, dep_glib, dep_gudev],
+ include_directories: [includes_src],
+ c_args: tools_cflags,
+ install: false)
updatedb = configure_file(input: 'tools/libwacom-update-db.py',
output: '@BASENAME@',
diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
index 0ba6cce..2f2c043 100644
--- a/tools/list-local-devices.c
+++ b/tools/list-local-devices.c
@@ -187,7 +187,11 @@ int main(int argc, char **argv)
db = libwacom_database_new_for_path(database_path);
g_free (database_path);
} else {
+#ifdef DATABASEPATH
+ db = libwacom_database_new_for_path(DATABASEPATH);
+#else
db = libwacom_database_new();
+#endif
}
if (!db) {