develop
Warmist 2011-08-09 00:34:49 +03:00
commit c1273982cf
4 changed files with 20 additions and 21 deletions

@ -8,6 +8,11 @@ ELSE()
SET ( LIBS m dl ) SET ( LIBS m dl )
ENDIF() ENDIF()
IF(UNIX)
add_definitions(-DLINUX_BUILD)
SET(CMAKE_C_FLAGS "-m32")
ENDIF()
# Build Libraries # Build Libraries
SET (SRC_LIBLUA SET (SRC_LIBLUA
src/lapi.c src/lapi.c

@ -1,7 +1,4 @@
find_package(Lua51 QUIET) include_directories(include)
if(LUA51_FOUND)
include_directories(${LUA_INCLUDE_DIR} include)
include_directories("${dfhack_SOURCE_DIR}/library/depends/tthread") include_directories("${dfhack_SOURCE_DIR}/library/depends/tthread")
FILE(GLOB DFUSION_CPPS src/*.c*) FILE(GLOB DFUSION_CPPS src/*.c*)
set( set(
@ -9,9 +6,5 @@ if(LUA51_FOUND)
dfusion.cpp dfusion.cpp
${DFUSION_CPPS} ${DFUSION_CPPS}
) )
DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL}) DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL} LINK_LIBRARIES lua)
target_link_libraries(dfusion ${LUA_LIBRARIES})
install(DIRECTORY luafiles/ DESTINATION ${DFHACK_DATA_DESTINATION}/dfusion) install(DIRECTORY luafiles/ DESTINATION ${DFHACK_DATA_DESTINATION}/dfusion)
else(LUA51_FOUND)
MESSAGE(STATUS "Required libraries (lua51) not found - dfusion plugin can't be built.")
endif(LUA51_FOUND)

@ -75,7 +75,7 @@ DFhackCExport command_result plugin_onupdate ( Core * c )
catch(lua::exception &e) catch(lua::exception &e)
{ {
c->con.printerr("Error OnTick:%s\n",e.what()); c->con.printerr("Error OnTick:%s\n",e.what());
c->con.printerr("%s",lua::DebugDump(lua::glua::Get())); c->con.printerr("%s",lua::DebugDump(lua::glua::Get()).c_str());
c->con.msleep(1000); c->con.msleep(1000);
} }
} }
@ -102,7 +102,7 @@ void InterpreterLoop(Core* c)
catch(lua::exception &e) catch(lua::exception &e)
{ {
con.printerr("Error:%s\n",e.what()); con.printerr("Error:%s\n",e.what());
c->con.printerr("%s",lua::DebugDump(lua::glua::Get())); c->con.printerr("%s",lua::DebugDump(lua::glua::Get()).c_str());
s.settop(0); s.settop(0);
} }
con.lineedit(">>",curline); con.lineedit(">>",curline);
@ -123,7 +123,7 @@ DFhackCExport command_result lua_run (Core * c, vector <string> & parameters)
catch(lua::exception &e) catch(lua::exception &e)
{ {
con.printerr("Error:%s\n",e.what()); con.printerr("Error:%s\n",e.what());
c->con.printerr("%s",lua::DebugDump(lua::glua::Get())); c->con.printerr("%s",lua::DebugDump(lua::glua::Get()).c_str());
} }
} }
else else
@ -148,7 +148,7 @@ DFhackCExport command_result dfusion (Core * c, vector <string> & parameters)
catch(lua::exception &e) catch(lua::exception &e)
{ {
con.printerr("Error:%s\n",e.what()); con.printerr("Error:%s\n",e.what());
c->con.printerr("%s",lua::DebugDump(lua::glua::Get())); c->con.printerr("%s",lua::DebugDump(lua::glua::Get()).c_str());
} }
s.settop(0);// clean up s.settop(0);// clean up
mymutex->unlock(); mymutex->unlock();

@ -2,6 +2,7 @@
#define FUNCTIONCALL__H #define FUNCTIONCALL__H
#include <vector> #include <vector>
using std::vector; using std::vector;
using std::size_t;
class FunctionCaller class FunctionCaller
{ {
public: public: