From e8be36243dd178b79ec793b4136660f8c27d7fca Mon Sep 17 00:00:00 2001 From: Hartmut Seichter Date: Wed, 16 Jan 2019 11:13:44 +0100 Subject: [PATCH] not dealing with SOL2 problem now --- src/deps/lua-5.3.5/CMakeLists.txt | 3 +-- src/scripting/src/script_system.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/deps/lua-5.3.5/CMakeLists.txt b/src/deps/lua-5.3.5/CMakeLists.txt index 8a5e67a..139832c 100644 --- a/src/deps/lua-5.3.5/CMakeLists.txt +++ b/src/deps/lua-5.3.5/CMakeLists.txt @@ -53,8 +53,7 @@ add_library (lualib STATIC ${libsrc} ) - - +target_compile_definitions(lualib PRIVATE LUA_USE_POSIX) if(UNIX) target_link_libraries( lualib m ) diff --git a/src/scripting/src/script_system.cpp b/src/scripting/src/script_system.cpp index b3a8c6d..5e1efc8 100644 --- a/src/scripting/src/script_system.cpp +++ b/src/scripting/src/script_system.cpp @@ -11,6 +11,7 @@ namespace pw { +#if defined(__clang) struct window_lua : public window { // overridable function sol::function lua_update; @@ -23,10 +24,13 @@ struct window_lua : public window { _on_update = [this](window&){this->lua_update();}; } }; +#endif void script_system::load(sol::table &ns) { + +#if defined(__clang) ns.new_usertype("window", sol::constructors(), "on_update",&window_lua::lua_update, @@ -36,6 +40,18 @@ void script_system::load(sol::table &ns) "position",sol::property(&window::position,&window::set_position), "fullscreen",sol::property(&window::fullscreen,&window::set_fullscreen) ); +#else + + + ns.new_usertype("window", + "update",&window::update, + "title",sol::writeonly_property(&window::set_title), + "size",sol::property(&window::size,&window::set_size), + "position",sol::property(&window::position,&window::set_position), + "fullscreen",sol::property(&window::fullscreen,&window::set_fullscreen) + ); + +#endif ns.new_usertype("input", "new", sol::no_constructor,