diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index 9a90bd744..7f64eb58b 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -21,26 +21,21 @@ if(ENABLE_BREAKPAD) include_directories(${CMAKE_SOURCE_DIR}/extern/breakpad/src ${Breakpad_Headers}) endif(ENABLE_BREAKPAD) -option(BUILD_WITH_LUA "Enable Terra/Lua language" ON) -option(FORCE_LUA "Use Lua instead Terra" OFF) +option(BUILD_WITH_LUA "Enable Lua language" ON) if(BUILD_WITH_LUA) - #set(Terra_ROOT ${CMAKE_SOURCE_DIR}/external/terra/) - if(WIN32 OR FORCE_LUA) - find_package(Lua51 REQUIRED) - MESSAGE(STATUS "Found LUA_LIBRARY: ${LUA_LIBRARY}") - MESSAGE(STATUS "Found LUA_INCLUDE_DIR: ${LUA_INCLUDE_DIR}") - else() - find_package(Terra REQUIRED) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_TERRA") - endif() + + find_package(Lua51 REQUIRED) + MESSAGE(STATUS "Found LUA_LIBRARY: ${LUA_LIBRARY}") + MESSAGE(STATUS "Found LUA_INCLUDE_DIR: ${LUA_INCLUDE_DIR}") + set(LuaScript_Sources Script/LangLua/LangLua.cpp Script/LangLua/LuaFunc.cpp) - set(LuaScript_Headers ${Terra_INCLUDES} ${LUA_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/extern/LuaBridge ${CMAKE_SOURCE_DIR}/extern/LuaBridge/detail + set(LuaScript_Headers ${LUA_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/extern/LuaBridge ${CMAKE_SOURCE_DIR}/extern/LuaBridge/detail Script/LangLua/LangLua.hpp) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_LUA") - include_directories(${Terra_INCLUDES} ${LUA_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/extern/LuaBridge) + include_directories(${LUA_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/extern/LuaBridge) endif(BUILD_WITH_LUA) set(NativeScript_Sources @@ -170,7 +165,6 @@ target_link_libraries(tes3mp-server #${Boost_PROGRAM_OPTIONS_LIBRARY} ${RakNet_LIBRARY} components - ${Terra_LIBRARY} ${LUA_LIBRARIES} ${Breakpad_Library} ${CallFF_LIBRARY} diff --git a/apps/openmw-mp/Script/LangLua/LangLua.cpp b/apps/openmw-mp/Script/LangLua/LangLua.cpp index a5d0893c4..5886bce10 100644 --- a/apps/openmw-mp/Script/LangLua/LangLua.cpp +++ b/apps/openmw-mp/Script/LangLua/LangLua.cpp @@ -23,9 +23,6 @@ LangLua::LangLua() { lua = luaL_newstate(); luaL_openlibs(lua); // load all lua std libs -#if defined(ENABLE_TERRA) - terra_init(lua); -#endif } LangLua::~LangLua() @@ -101,11 +98,7 @@ void LangLua::LoadProgram(const char *filename) { int err = 0; -#if defined(ENABLE_TERRA) - if ((err = terra_loadfile(lua, filename)) != 0) -#else if ((err =luaL_loadfile(lua, filename)) != 0) -#endif throw runtime_error("Lua script " + string(filename) + " error (" + to_string(err) + "): \"" + string(lua_tostring(lua, -1)) + "\""); diff --git a/apps/openmw-mp/Script/LangLua/LangLua.hpp b/apps/openmw-mp/Script/LangLua/LangLua.hpp index 8aecf1418..0cc818c34 100644 --- a/apps/openmw-mp/Script/LangLua/LangLua.hpp +++ b/apps/openmw-mp/Script/LangLua/LangLua.hpp @@ -5,11 +5,7 @@ #ifndef PLUGINSYSTEM3_LANGLUA_HPP #define PLUGINSYSTEM3_LANGLUA_HPP -#ifdef ENABLE_TERRA -#include -#else #include "lua.hpp" -#endif #include #include diff --git a/apps/openmw-mp/Script/Script.cpp b/apps/openmw-mp/Script/Script.cpp index 3740487b0..17c3f48a7 100644 --- a/apps/openmw-mp/Script/Script.cpp +++ b/apps/openmw-mp/Script/Script.cpp @@ -86,9 +86,6 @@ void Script::UnloadScripts() { //Public::DeleteAll(); scripts.clear(); -#if defined (ENABLE_TERRA) - terra_llvmshutdown(); -#endif } void Script::LoadScript(const char *script, const char *base) diff --git a/cmake/FindTerra.cmake b/cmake/FindTerra.cmake deleted file mode 100644 index 199e47d0d..000000000 --- a/cmake/FindTerra.cmake +++ /dev/null @@ -1,69 +0,0 @@ -# - Try to find Terra -# Once done this will define -# -# Terra_FOUND - system has Terra -# Terra_INCLUDES - the Terra include directory -# Terra_LIBRARY - Link these to use Terra - -FIND_LIBRARY (Terra_LIBRARY_RELEASE NAMES terra - PATHS - ENV LD_LIBRARY_PATH - ENV LIBRARY_PATH - /usr/lib64 - /usr/lib - /usr/local/lib64 - /usr/local/lib - /opt/local/lib - $ENV{Terra_ROOT}/lib - ) - -FIND_LIBRARY (Terra_LIBRARY_DEBUG NAMES terra - PATHS - ENV LD_LIBRARY_PATH - ENV LIBRARY_PATH - /usr/lib64 - /usr/lib - /usr/local/lib64 - /usr/local/lib - /opt/local/lib - $ENV{Terra_ROOT}/lib - ) - -FIND_PATH (Terra_INCLUDES terra/terra.h - ENV CPATH - /usr/include - /usr/local/include - /opt/local/include - $ENV{Terra_ROOT}/include - ) - -IF(Terra_INCLUDES AND Terra_LIBRARY_RELEASE) - SET(Terra_FOUND TRUE) -ENDIF(Terra_INCLUDES AND Terra_LIBRARY_RELEASE) - -IF(NOT Terra_LIBRARY_DEBUG) - SET(Terra_LIBRARY_DEBUG ${Terra_LIBRARY_RELEASE}) -ENDIF() - -IF(Terra_FOUND) - SET(Terra_INCLUDES ${Terra_INCLUDES}) - - find_package(ZLIB REQUIRED) - - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(Terra_LIBRARY optimized ${Terra_LIBRARY_RELEASE} debug ${Terra_LIBRARY_DEBUG} ${ZLIB_LIBRARIES} dl tinfo) - ELSE() - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - SET(Terra_LIBRARY ${Terra_LIBRARY_RELEASE} ${ZLIB_LIBRARIES} dl tinfo) - ENDIF() - IF(NOT Terra_FIND_QUIETLY) - MESSAGE(STATUS "Found Terra_LIBRARY_RELEASE: ${Terra_LIBRARY_RELEASE}") - MESSAGE(STATUS "Found Terra_INCLUDES: ${Terra_INCLUDES}") - ENDIF(NOT Terra_FIND_QUIETLY) -ELSE(Terra_FOUND) - IF(Terra_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Terra") - ENDIF(Terra_FIND_REQUIRED) -ENDIF(Terra_FOUND) -