Did some various fixes particular to CMake detection so it can better find later versions of Lua as well as LuaJIT.
Also had to fix some of the lua C calls carryover from pre Lua 5.2, like luaL_register and lua_strlen. I know LUA_COMPAT_MODULE can be defined for backwards compatibility but it assumes that the lua runtime has luaL_openlib compiled in (luaL_register is a #define into luaL_openlib. I ran into linking issues since my runtime didn't have it.
It seems to make more sense to just make luacom use the latest Lua C api and put any compatibility code in LuaCompat.* to smooth out version differences. It helps reduce #ifdef litter into other source files.
Last thing, added a rockspec file that uses cmake to build since it's already in the project.
Did some various fixes particular to CMake detection so it can better find later versions of Lua as well as LuaJIT.
Also had to fix some of the lua C calls carryover from pre Lua 5.2, like
luaL_register
andlua_strlen
. I knowLUA_COMPAT_MODULE
can be defined for backwards compatibility but it assumes that the lua runtime hasluaL_openlib
compiled in (luaL_register
is a#define
intoluaL_openlib
. I ran into linking issues since my runtime didn't have it.It seems to make more sense to just make luacom use the latest Lua C api and put any compatibility code in LuaCompat.* to smooth out version differences. It helps reduce
#ifdef
litter into other source files.Last thing, added a rockspec file that uses cmake to build since it's already in the project.