[General] Remove Terra support

Use LuaJIT instead.
0.6.3
Koncord 7 years ago
parent 685a80887b
commit 62877f38b7

@ -21,26 +21,21 @@ if(ENABLE_BREAKPAD)
include_directories(${CMAKE_SOURCE_DIR}/extern/breakpad/src ${Breakpad_Headers}) include_directories(${CMAKE_SOURCE_DIR}/extern/breakpad/src ${Breakpad_Headers})
endif(ENABLE_BREAKPAD) endif(ENABLE_BREAKPAD)
option(BUILD_WITH_LUA "Enable Terra/Lua language" ON) option(BUILD_WITH_LUA "Enable Lua language" ON)
option(FORCE_LUA "Use Lua instead Terra" OFF)
if(BUILD_WITH_LUA) if(BUILD_WITH_LUA)
#set(Terra_ROOT ${CMAKE_SOURCE_DIR}/external/terra/)
if(WIN32 OR FORCE_LUA)
find_package(Lua51 REQUIRED) find_package(Lua51 REQUIRED)
MESSAGE(STATUS "Found LUA_LIBRARY: ${LUA_LIBRARY}") MESSAGE(STATUS "Found LUA_LIBRARY: ${LUA_LIBRARY}")
MESSAGE(STATUS "Found LUA_INCLUDE_DIR: ${LUA_INCLUDE_DIR}") MESSAGE(STATUS "Found LUA_INCLUDE_DIR: ${LUA_INCLUDE_DIR}")
else()
find_package(Terra REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_TERRA")
endif()
set(LuaScript_Sources set(LuaScript_Sources
Script/LangLua/LangLua.cpp Script/LangLua/LangLua.cpp
Script/LangLua/LuaFunc.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) Script/LangLua/LangLua.hpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_LUA") 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) endif(BUILD_WITH_LUA)
set(NativeScript_Sources set(NativeScript_Sources
@ -170,7 +165,6 @@ target_link_libraries(tes3mp-server
#${Boost_PROGRAM_OPTIONS_LIBRARY} #${Boost_PROGRAM_OPTIONS_LIBRARY}
${RakNet_LIBRARY} ${RakNet_LIBRARY}
components components
${Terra_LIBRARY}
${LUA_LIBRARIES} ${LUA_LIBRARIES}
${Breakpad_Library} ${Breakpad_Library}
${CallFF_LIBRARY} ${CallFF_LIBRARY}

@ -23,9 +23,6 @@ LangLua::LangLua()
{ {
lua = luaL_newstate(); lua = luaL_newstate();
luaL_openlibs(lua); // load all lua std libs luaL_openlibs(lua); // load all lua std libs
#if defined(ENABLE_TERRA)
terra_init(lua);
#endif
} }
LangLua::~LangLua() LangLua::~LangLua()
@ -101,11 +98,7 @@ void LangLua::LoadProgram(const char *filename)
{ {
int err = 0; int err = 0;
#if defined(ENABLE_TERRA)
if ((err = terra_loadfile(lua, filename)) != 0)
#else
if ((err =luaL_loadfile(lua, filename)) != 0) if ((err =luaL_loadfile(lua, filename)) != 0)
#endif
throw runtime_error("Lua script " + string(filename) + " error (" + to_string(err) + "): \"" + throw runtime_error("Lua script " + string(filename) + " error (" + to_string(err) + "): \"" +
string(lua_tostring(lua, -1)) + "\""); string(lua_tostring(lua, -1)) + "\"");

@ -5,11 +5,7 @@
#ifndef PLUGINSYSTEM3_LANGLUA_HPP #ifndef PLUGINSYSTEM3_LANGLUA_HPP
#define PLUGINSYSTEM3_LANGLUA_HPP #define PLUGINSYSTEM3_LANGLUA_HPP
#ifdef ENABLE_TERRA
#include <terra/terra.h>
#else
#include "lua.hpp" #include "lua.hpp"
#endif
#include <extern/LuaBridge/LuaBridge.h> #include <extern/LuaBridge/LuaBridge.h>
#include <LuaBridge.h> #include <LuaBridge.h>

@ -86,9 +86,6 @@ void Script::UnloadScripts()
{ {
//Public::DeleteAll(); //Public::DeleteAll();
scripts.clear(); scripts.clear();
#if defined (ENABLE_TERRA)
terra_llvmshutdown();
#endif
} }
void Script::LoadScript(const char *script, const char *base) void Script::LoadScript(const char *script, const char *base)

@ -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)
Loading…
Cancel
Save