diff --git a/plugins/meson.build b/plugins/meson.build index e45e4c6c..b87aaa99 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -22,7 +22,31 @@ if get_option('with-fishlim') subdir('fishlim') endif -if get_option('with-lua') != 'false' +lua_option = get_option('with-lua') +if lua_option == 'auto' or lua_option == 'luajit' + lua_auto_dep = dependency('luajit', required: false) + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua-5.4', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua5.4', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua-5.3', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua5.3', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua', required: false) + endif + + if lua_auto_dep.found() + subdir('lua') + else + warning('LuaJIT/Lua development files not found, disabling Lua plugin') + endif +elif lua_option != 'false' subdir('lua') endif