Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Lua53 fixes #23

wants to merge 8 commits into from

Conversation

greatwolf
Copy link

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.

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
IF(LUA_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${LUA_EXECUTABLE} -v
OUTPUT_VARIABLE lua_version_str
ERROR_VARIABLE lua_version_str)
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant