From 4011d2fc7c57758c211ee5df47a9feaf9c24b225 Mon Sep 17 00:00:00 2001 From: reinder Date: Sat, 2 May 2020 00:04:26 +0200 Subject: [PATCH] fixes for linux/cmake 3.10 and other tweaks --- server/CMakeLists.txt | 7 +++---- server/src/lua/sandbox.cpp | 9 --------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 332d7ba7..3d835375 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.9) project(traintastic-server VERSION 0.1.0 DESCRIPTION "Traintastic server") include(GNUInstallDirs) -add_executable(traintastic-server) +add_executable(traintastic-server src/main.cpp src/options.hpp) add_definitions( -DVERSION=${PROJECT_VERSION} @@ -20,8 +20,6 @@ target_include_directories(traintastic-server PRIVATE thirdparty/boost) file(GLOB SOURCES - "src/*.hpp" - "src/*.cpp" "src/clock/*.hpp" "src/clock/*.cpp" "src/core/*.hpp" @@ -65,7 +63,8 @@ option(ENABLE_LUA_SCRIPTING "Lua scripting support" ON) message(STATUS "Lua scripting support: ${ENABLE_LUA_SCRIPTING}") if(ENABLE_LUA_SCRIPTING) find_package(Lua 5.3 REQUIRED) - file(GLOB SOURCES "src/lua/*.hpp" "src/lua/*.cpp") + file(GLOB SOURCES_LUA "src/lua/*.hpp" "src/lua/*.cpp") + list(APPEND SOURCES ${SOURCES_LUA}) target_include_directories(traintastic-server PRIVATE ${LUA_INCLUDE_DIR}) target_link_libraries(traintastic-server ${LUA_LIBRARIES}) else() diff --git a/server/src/lua/sandbox.cpp b/server/src/lua/sandbox.cpp index 78384930..5ac9132d 100644 --- a/server/src/lua/sandbox.cpp +++ b/server/src/lua/sandbox.cpp @@ -27,7 +27,6 @@ #include "console.hpp" #include #include "../core/world.hpp" -#include "../enum/traintasticmode.hpp" #include "../enum/decoderprotocol.hpp" #include "../enum/direction.hpp" #include "../enum/worldevent.hpp" @@ -61,7 +60,6 @@ SandboxPtr Sandbox::create(Script& script) *static_cast(lua_getextraspace(L)) = new StateData(script); // register types: - Enum::registerType(L); Enum::registerType(L); Enum::registerType(L); Enum::registerType(L); @@ -90,15 +88,8 @@ SandboxPtr Sandbox::create(Script& script) Console::push(L); lua_setfield(L, -2, "console"); - -push(L, script.world().lock()->getObject("dec_br211")); -lua_setfield(L, -2, "dec"); - - - // add enum values: lua_newtable(L); - Enum::registerValues(L); Enum::registerValues(L); Enum::registerValues(L); Enum::registerValues(L);