Proper pkg-config and error handling on script load
This commit is contained in:
parent
4a00d26cb9
commit
7975b92532
4
Makefile
4
Makefile
|
@ -1,5 +1,5 @@
|
||||||
CFLAGS +=
|
CFLAGS += `pkg-config --cflags cairo xcb lua53`
|
||||||
LDFLAGS := -lm -lcairo -lxcb -llua5.3
|
LDFLAGS := `pkg-config --libs cairo xcb lua53`
|
||||||
OBJECTS := obj/common.o obj/rootwindow.o obj/cairo_context.o obj/api_draw.o
|
OBJECTS := obj/common.o obj/rootwindow.o obj/cairo_context.o obj/api_draw.o
|
||||||
|
|
||||||
livewp: lib
|
livewp: lib
|
||||||
|
|
|
@ -32,8 +32,13 @@ int main(void) {
|
||||||
global_context.lua = luaL_newstate();
|
global_context.lua = luaL_newstate();
|
||||||
luaL_openlibs(global_context.lua);
|
luaL_openlibs(global_context.lua);
|
||||||
loadapi_draw(global_context.lua);
|
loadapi_draw(global_context.lua);
|
||||||
|
|
||||||
if (luaL_dofile(global_context.lua, "example.lua") == LUA_OK) {
|
if (luaL_dofile(global_context.lua, "example.lua") == LUA_OK) {
|
||||||
lua_pop(global_context.lua, lua_gettop(global_context.lua));
|
lua_pop(global_context.lua, lua_gettop(global_context.lua));
|
||||||
|
} else {
|
||||||
|
printf("ERROR: %s\n", lua_tostring(global_context.lua, lua_gettop(global_context.lua)));
|
||||||
|
lua_pop(global_context.lua, lua_gettop(global_context.lua));
|
||||||
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue