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,17 +1,10 @@
find_package(Lua51 QUIET) include_directories(include)
include_directories("${dfhack_SOURCE_DIR}/library/depends/tthread")
if(LUA51_FOUND) FILE(GLOB DFUSION_CPPS src/*.c*)
include_directories(${LUA_INCLUDE_DIR} include) set(
include_directories("${dfhack_SOURCE_DIR}/library/depends/tthread") DFUSION_CPPS_ALL
FILE(GLOB DFUSION_CPPS src/*.c*) dfusion.cpp
set( ${DFUSION_CPPS}
DFUSION_CPPS_ALL )
dfusion.cpp DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL} LINK_LIBRARIES lua)
${DFUSION_CPPS} install(DIRECTORY luafiles/ DESTINATION ${DFHACK_DATA_DESTINATION}/dfusion)
)
DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL})
target_link_libraries(dfusion ${LUA_LIBRARIES})
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: