mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 22:55:40 +12:00
Update luv bindings to be disabled on Android
This commit is contained in:
parent
8cee60ebf5
commit
362b8e6621
2 changed files with 14 additions and 10 deletions
|
@ -40,11 +40,6 @@ option(ENABLE_LUAJIT "Enable scripting with the Lua programming language" ON)
|
||||||
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
||||||
option(BUILD_HYDRA_CORE "Build a Hydra core" OFF)
|
option(BUILD_HYDRA_CORE "Build a Hydra core" OFF)
|
||||||
|
|
||||||
if(ENABLE_LUAJIT AND ANDROID)
|
|
||||||
message(STATUS "Enabled LuaJIT on Android build. Automatically disabling it until it works properly")
|
|
||||||
set(ENABLE_LUAJIT OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/include/)
|
include_directories(${PROJECT_SOURCE_DIR}/include/)
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/include/kernel)
|
include_directories(${PROJECT_SOURCE_DIR}/include/kernel)
|
||||||
include_directories (${FMT_INCLUDE_DIR})
|
include_directories (${FMT_INCLUDE_DIR})
|
||||||
|
@ -271,8 +266,8 @@ set(THIRD_PARTY_SOURCE_FILES third_party/imgui/imgui.cpp
|
||||||
third_party/xxhash/xxhash.c
|
third_party/xxhash/xxhash.c
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_LUAJIT)
|
if(ENABLE_LUAJIT AND NOT ANDROID)
|
||||||
# Build luv and libuv for TCP Lua server usage
|
# Build luv and libuv for Lua TCP server usage if we're not on Android
|
||||||
include_directories(third_party/luv/src)
|
include_directories(third_party/luv/src)
|
||||||
include_directories(third_party/luv/deps/lua-compat-5.3/c-api)
|
include_directories(third_party/luv/deps/lua-compat-5.3/c-api)
|
||||||
include_directories(third_party/libuv/include)
|
include_directories(third_party/libuv/include)
|
||||||
|
@ -446,7 +441,12 @@ endif()
|
||||||
|
|
||||||
if(ENABLE_LUAJIT)
|
if(ENABLE_LUAJIT)
|
||||||
target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_LUA=1")
|
target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_LUA=1")
|
||||||
target_link_libraries(Alber PRIVATE libluajit uv_a)
|
target_link_libraries(Alber PRIVATE libluajit)
|
||||||
|
|
||||||
|
# If we're not on Android, link libuv too
|
||||||
|
if (NOT ANDROID)
|
||||||
|
target_link_libraries(Alber PRIVATE uv_a)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_OPENGL)
|
if(ENABLE_OPENGL)
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#ifdef PANDA3DS_ENABLE_LUA
|
#ifdef PANDA3DS_ENABLE_LUA
|
||||||
#include "lua_manager.hpp"
|
#include "lua_manager.hpp"
|
||||||
|
|
||||||
|
#ifndef __ANDROID__
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "luv.h"
|
#include "luv.h"
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void LuaManager::initialize() {
|
void LuaManager::initialize() {
|
||||||
L = luaL_newstate(); // Open Lua
|
L = luaL_newstate(); // Open Lua
|
||||||
|
@ -13,13 +15,15 @@ void LuaManager::initialize() {
|
||||||
initialized = false;
|
initialized = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
luaL_openlibs(L);
|
luaL_openlibs(L);
|
||||||
|
|
||||||
|
#ifndef __ANDROID__
|
||||||
lua_pushstring(L, "luv");
|
lua_pushstring(L, "luv");
|
||||||
luaopen_luv(L);
|
luaopen_luv(L);
|
||||||
lua_settable(L, LUA_GLOBALSINDEX);
|
lua_settable(L, LUA_GLOBALSINDEX);
|
||||||
initializeThunks();
|
#endif
|
||||||
|
|
||||||
|
initializeThunks();
|
||||||
initialized = true;
|
initialized = true;
|
||||||
haveScript = false;
|
haveScript = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue