Skip to content

Commit

Permalink
tools: setenv the quirks dir when running from the build directory
Browse files Browse the repository at this point in the history
Fixes #84

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Jul 17, 2018
1 parent ad5d2fe commit c7a9b20
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/shared.c
Expand Up @@ -311,6 +311,13 @@ tools_open_device(const char *path, bool verbose, bool *grab)
return li;
}

static void
tools_setenv_quirks_dir(void)
{
if (tools_execdir_is_builddir(NULL, 0))
setenv("LIBINPUT_QUIRKS_DIR", LIBINPUT_QUIRKS_SRCDIR, 0);
}

struct libinput *
tools_open_backend(enum tools_backend which,
const char *seat_or_device,
Expand All @@ -319,6 +326,8 @@ tools_open_backend(enum tools_backend which,
{
struct libinput *li;

tools_setenv_quirks_dir();

switch (which) {
case BACKEND_UDEV:
li = tools_open_udev(seat_or_device, verbose, grab);
Expand Down

0 comments on commit c7a9b20

Please sign in to comment.