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

View File

@@ -553,8 +553,11 @@ if(NOT WIN32)
endif()
endforeach()
elseif(LUA_PRG MATCHES "luajit")
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()
if(LUAC_PRG)