Tangent128 / luasdl2

A pure C binding of SDL 2.0 for Lua 5.1, Lua 5.2, and LuaJIT.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling on OSX Bug Sur (Intel)

PeterHickman opened this issue · comments

Using luarocks to install lua-sdl2 and I am hitting an issue

/usr/local/include/SDL2/SDL_platform.h:87:3: error: SDL for Mac OS X only supports deploying on 10.6 and above.
# error SDL for Mac OS X only supports deploying on 10.6 and above.

Nuking line 87 allows the build to complete but with ton of warnings Building for Intel with Mac OS X Deployment Target < 10.4 is invalid and was built for newer macOS version (10.5) than being linked (10.1)

A quick test with some example scripts shows that it seems to be working

Is this the build process not being set up correctly for Big Sur or are the Apple development tools not ready yet

I have not been able to maintain luasdl2 for quite some time, so any changes that would need to be made for Big Sur have not been made, indeed.

If you can figure out what changes need to be made and open a PR, I may be able to look at it before the end of the year.

I think the problem comes from LuaRocks because the default installation of LuaRocks specify some CFLAGS that are too old. If you compile from CMake you don't get any error.

I've myself changed the luarocks configuration to look like this:

markand@lotus ~ $ cat /usr/local/etc/luarocks/config-5.3.lua 
-- LuaRocks configuration

rocks_trees = {
   { name = "user", root = home .. "/.luarocks" };
   { name = "system", root = "/usr/local" };
}
lua_interpreter = "lua5.3";
variables = {
	LUA_DIR = "/usr/local/opt/lua";
	LUA_BINDIR = "/usr/local/opt/lua/bin";
	CC = "export MACOSX_DEPLOYMENT_TARGET=11.0; cc ",
	LD = "export MACOSX_DEPLOYMENT_TARGET=11.0; cc "
}

I think the issue is up to LuaRocks only unless the rockspec is wrong.