fix(build): check that LuaJIT has required modules for compilation (#16714)

Apparently some installations of LuaJIT do not have the "jit.bcsave"
module which is required for pre-compilation. Check that this module
exists before using LuaJIT as luac and if it doesn't, skip compiling
bytecode.
This commit is contained in:
Gregory Anders 2021-12-18 20:59:02 -07:00 committed by GitHub
parent b42e0c40c8
commit abdf3a8128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -553,7 +553,10 @@ if(NOT WIN32)
endif()
endforeach()
elseif(LUA_PRG MATCHES "luajit")
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
if(LUAJIT_HAS_JIT_BCSAVE)
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
endif()
endif()
endif()