-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua53 fixes #23
base: master
Are you sure you want to change the base?
Lua53 fixes #23
Conversation
find lua executables with suffix. eg. fails to find something like 'lua53.exe'
This should be refactored so luacom module isn't dumped into global space but one step at a time.
Added compatibility code so luacom can still build under Lua 5.1
than matching against lua headers.
IF(LUA_EXECUTABLE) | ||
EXECUTE_PROCESS(COMMAND ${LUA_EXECUTABLE} -v | ||
OUTPUT_VARIABLE lua_version_str | ||
ERROR_VARIABLE lua_version_str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to mention, for some reason Lua 5.1 seems to output the version string to stderr
. At least that's the case for me under Win7. That's the reason for setting ERROR_VARIABLE
to lua_version_str
here, in case the interpreter splits out the version string to stderr, cmake will capture it.
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.