feat(lua): Port of NodeMCU Lua53 read-only tables (#2994)
* chore(lua): revert useless c light function change This change was part of the eLua LTR patches (based on 5.1), whereby this feature was already integrated in Lua 5.2. * feat(lua): port of NodeMCU Lua53 read-only tables # Conflicts: # radio/src/lua/CMakeLists.txt # radio/src/lua/api_general.cpp * fix(nv14): missing SDRAM definition * fix: l_mathop * fix: use float functions in drawPower() * fix: ltable resize * fix: correct name is "bit32" * fix: first Lua context must be closed last As the lookup cache is attached to that one * Revert to Lua using double * Ensure byte-code compatibility * Fix possible compatibility issue with `lua_typename`/`luaL_typename` * Fix Bitmap symbol table * Re-add table lib for COLORLCD
This commit is contained in:
@@ -107,7 +107,6 @@ endif()
|
||||
|
||||
add_subdirectory(bitmaps)
|
||||
add_subdirectory(fonts)
|
||||
add_subdirectory(lua)
|
||||
|
||||
if(NOT PCB STREQUAL 9XRPRO)
|
||||
option(DBLKEYS "Double Keys" ON)
|
||||
@@ -177,78 +176,7 @@ if(RTC_BACKUP_RAM)
|
||||
endif()
|
||||
|
||||
if(LUA)
|
||||
add_definitions(-DLUA)
|
||||
if(LUA_COMPILER)
|
||||
add_definitions(-DLUA_COMPILER)
|
||||
endif()
|
||||
if(LUA_ALLOCATOR_TRACER AND DEBUG)
|
||||
add_definitions(-DLUA_ALLOCATOR_TRACER)
|
||||
endif()
|
||||
if(NOT "${LUA_SCRIPT_LOAD_MODE}" STREQUAL "")
|
||||
add_definitions(-DLUA_SCRIPT_LOAD_MODE="${LUA_SCRIPT_LOAD_MODE}")
|
||||
endif()
|
||||
include_directories(${LUA_DIR})
|
||||
set(RADIO_DEPENDENCIES ${RADIO_DEPENDENCIES} ${LUA_EXPORT})
|
||||
if(LUA_MIXER)
|
||||
add_definitions(-DLUA_MODEL_SCRIPTS)
|
||||
endif()
|
||||
|
||||
# TODO: LUA CMAKE
|
||||
set(SRC ${SRC}
|
||||
lua/interface.cpp
|
||||
lua/api_general.cpp
|
||||
lua/api_model.cpp
|
||||
lua/api_filesystem.cpp
|
||||
lua/lua_event.cpp
|
||||
)
|
||||
|
||||
if(GUI_DIR STREQUAL colorlcd)
|
||||
set(SRC ${SRC} lua/api_colorlcd.cpp lua/widgets.cpp)
|
||||
else()
|
||||
set(SRC ${SRC} lua/api_stdlcd.cpp)
|
||||
endif()
|
||||
|
||||
set(LUA_SRC
|
||||
lapi.c
|
||||
lcode.c
|
||||
lctype.c
|
||||
ldebug.c
|
||||
ldo.c
|
||||
ldump.c
|
||||
lfunc.c
|
||||
lgc.c
|
||||
llex.c
|
||||
lmem.c
|
||||
lobject.c
|
||||
lopcodes.c
|
||||
lparser.c
|
||||
lstate.c
|
||||
lstring.c
|
||||
ltable.c
|
||||
lrotable.c
|
||||
ltm.c
|
||||
lundump.c
|
||||
lvm.c
|
||||
lzio.c
|
||||
linit.c
|
||||
lbaselib.c
|
||||
lmathlib.c
|
||||
lbitlib.c
|
||||
loadlib.c
|
||||
lauxlib.c
|
||||
ltablib.c
|
||||
lcorolib.c
|
||||
liolib.c
|
||||
lstrlib.c
|
||||
)
|
||||
|
||||
foreach(FILE ${LUA_SRC})
|
||||
set(SRC ${SRC} ${LUA_DIR}/${FILE})
|
||||
endforeach()
|
||||
if(MSVC)
|
||||
# silence lots of warnings regarding "insecure" use of functions (sprintf, strcpy, etc) from Lua code
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} /D_CRT_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
include(lua/CMakeLists.txt)
|
||||
endif()
|
||||
|
||||
if (LUA_MIXER AND NOT LUA)
|
||||
|
||||
Reference in New Issue
Block a user