fixes for linux/cmake 3.10 and other tweaks

Dieser Commit ist enthalten in:
reinder 2020-05-02 00:04:26 +02:00
Ursprung d5743edd4c
Commit 4011d2fc7c
2 geänderte Dateien mit 3 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -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()

Datei anzeigen

@ -27,7 +27,6 @@
#include "console.hpp"
#include <utils/str.hpp>
#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<StateData**>(lua_getextraspace(L)) = new StateData(script);
// register types:
Enum<TraintasticMode>::registerType(L);
Enum<DecoderProtocol>::registerType(L);
Enum<Direction>::registerType(L);
Enum<WorldEvent>::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<TraintasticMode>::registerValues(L);
Enum<DecoderProtocol>::registerValues(L);
Enum<Direction>::registerValues(L);
Enum<WorldEvent>::registerValues(L);