diff --git a/meson.build b/meson.build index 35d07552..39244f80 100644 --- a/meson.build +++ b/meson.build @@ -171,10 +171,14 @@ dep_rt = cc.find_library('rt', required : false) dep_lua = dependency(get_option('lua-interpreter'), required : get_option('lua-plugins')) have_lua = dep_lua.found() -config_h.set10('HAVE_LUA', have_lua) +if have_lua + config_h.set('HAVE_LUA', 1) +endif have_plugins = dep_lua.found() -config_h.set10('HAVE_PLUGINS', have_plugins) +if have_plugins + config_h.set('HAVE_PLUGINS', 1) +endif summary({ 'Plugins enabled' : have_plugins, diff --git a/src/libinput-plugin.c b/src/libinput-plugin.c index 81c45fe9..bee11732 100644 --- a/src/libinput-plugin.c +++ b/src/libinput-plugin.c @@ -382,7 +382,7 @@ libinput_plugin_system_load_plugins(struct libinput *libinput, return 0; } -#if HAVE_LUA +#ifdef HAVE_LUA _autostrvfree_ char **directories = steal(&libinput->plugin_system.directories); size_t nfiles = 0; _autostrvfree_ char **plugin_files = @@ -400,10 +400,10 @@ libinput_plugin_system_load_plugins(struct libinput *libinput, libinput_plugin_system_run(&libinput->plugin_system); -#if !HAVE_PLUGINS - return -ENOSYS; -#else +#ifdef HAVE_PLUGINS return 0; +#else + return -ENOSYS; #endif }