From 8fd437dbc1caebf7a8f8b8668e2fe6a2b907f498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 8 Aug 2011 23:30:30 +0200 Subject: [PATCH] Make dfusion use the static lua lib. --- lua/CMakeLists.txt | 5 +++++ plugins/Dfusion/CMakeLists.txt | 27 ++++++++++---------------- plugins/Dfusion/dfusion.cpp | 8 ++++---- plugins/Dfusion/include/functioncall.h | 1 + 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt index 7d6a97a8d..7203ae666 100644 --- a/lua/CMakeLists.txt +++ b/lua/CMakeLists.txt @@ -8,6 +8,11 @@ ELSE() SET ( LIBS m dl ) ENDIF() +IF(UNIX) + add_definitions(-DLINUX_BUILD) + SET(CMAKE_C_FLAGS "-m32") +ENDIF() + # Build Libraries SET (SRC_LIBLUA src/lapi.c diff --git a/plugins/Dfusion/CMakeLists.txt b/plugins/Dfusion/CMakeLists.txt index 0607406d4..13dd1bd98 100644 --- a/plugins/Dfusion/CMakeLists.txt +++ b/plugins/Dfusion/CMakeLists.txt @@ -1,17 +1,10 @@ -find_package(Lua51 QUIET) - -if(LUA51_FOUND) - include_directories(${LUA_INCLUDE_DIR} include) - include_directories("${dfhack_SOURCE_DIR}/library/depends/tthread") - FILE(GLOB DFUSION_CPPS src/*.c*) - set( - DFUSION_CPPS_ALL - dfusion.cpp - ${DFUSION_CPPS} - ) - 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) +include_directories(include) +include_directories("${dfhack_SOURCE_DIR}/library/depends/tthread") +FILE(GLOB DFUSION_CPPS src/*.c*) +set( + DFUSION_CPPS_ALL + dfusion.cpp + ${DFUSION_CPPS} +) +DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL} LINK_LIBRARIES lua) +install(DIRECTORY luafiles/ DESTINATION ${DFHACK_DATA_DESTINATION}/dfusion) diff --git a/plugins/Dfusion/dfusion.cpp b/plugins/Dfusion/dfusion.cpp index 79b8f1f94..67e09b07c 100644 --- a/plugins/Dfusion/dfusion.cpp +++ b/plugins/Dfusion/dfusion.cpp @@ -75,7 +75,7 @@ DFhackCExport command_result plugin_onupdate ( Core * c ) catch(lua::exception &e) { 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); } } @@ -102,7 +102,7 @@ void InterpreterLoop(Core* c) catch(lua::exception &e) { 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); } con.lineedit(">>",curline); @@ -123,7 +123,7 @@ DFhackCExport command_result lua_run (Core * c, vector & parameters) catch(lua::exception &e) { 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 @@ -148,7 +148,7 @@ DFhackCExport command_result dfusion (Core * c, vector & parameters) catch(lua::exception &e) { 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 mymutex->unlock(); diff --git a/plugins/Dfusion/include/functioncall.h b/plugins/Dfusion/include/functioncall.h index 9f041d1d3..8e3097f1c 100644 --- a/plugins/Dfusion/include/functioncall.h +++ b/plugins/Dfusion/include/functioncall.h @@ -2,6 +2,7 @@ #define FUNCTIONCALL__H #include using std::vector; +using std::size_t; class FunctionCaller { public: