add luabind-test.cpp

all programs using luabind should define LUA_COMPAT_ALL
pull/484/head
Boris Nagaev 10 years ago
parent 22612efbdb
commit 950ef6f854

@ -0,0 +1,29 @@
#include <iostream>
#include <luabind/luabind.hpp>
#include <lua.hpp>
void greet()
{
std::cout << "hello world!\n";
}
extern "C" int init(lua_State* L)
{
using namespace luabind;
open(L);
module(L)
[
def("greet", &greet)
];
return 0;
}
int main()
{
lua_State* L = luaL_newstate();
init(L);
luaL_dostring(L, "greet()");
}

@ -23,6 +23,12 @@ define $(PKG)_BUILD
'$(1)'
$(MAKE) -C '$(1).build' -j '$(JOBS)' VERBOSE=1 || $(MAKE) -C '$(1).build' -j 1 VERBOSE=1
$(MAKE) -C '$(1).build' -j 1 install VERBOSE=1
# all programs using luabind should define LUA_COMPAT_ALL
'$(TARGET)-g++' \
-W -Wall -DLUA_COMPAT_ALL \
'$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-luabind.exe' \
-llua -lluabind
endef
$(PKG)_BUILD_x86_64-w64-mingw32 =

Loading…
Cancel
Save