Issue #10725: do not test for lua-lgi when lua can't be run.

In particular in a cross-compilation environment where you don't have an exe
wrapper or cross-host run ability, you still want to be able to configure GIMP.

It is also possible to install lua scripts anyway with -Dlua=enabled, bypassing
ability to test lua-lgi presence (a warning will be outputted at configuration
time, but no error).
This commit is contained in:
Jehan 2024-02-01 16:29:10 +01:00
parent 0902e45901
commit e7b85e3d67

View file

@ -1152,7 +1152,7 @@ if get_option('lua').allowed()
foreach lua_bin : [ 'luajit', 'lua5.1', 'lua5.2', 'lua5.3' ]
lua = find_program(lua_bin, required: false)
if lua.found()
if lua.found() and meson.can_run_host_binaries()
have_lua_lgi = run_command(lua, '-e',
'''
local lgi = require 'lgi'
@ -1169,7 +1169,8 @@ if get_option('lua').allowed()
have_lua = get_option('lua').enabled() or have_lua_lgi
if have_lua and not have_lua_lgi
lua_warning = '''
Neither Luajit nor Lua, with lua-lgi support, was found.
Neither Luajit nor Lua, with lua-lgi support, was found. Or you are
cross-compiling so we couldn't test lua-lgi support.
Lua plug-ins will be installed anyway but you should make sure that
luajit or lua and that LGI are available at installation, otherwise
installed plug-ins won't be usable.