Merge pull request #1282 from EdgeTX/pfeerick/issue395
End the LUA != LUA confusion
This commit is contained in:
@@ -36,6 +36,7 @@ if(SDL_FOUND)
|
||||
option(SIMU_AUDIO "Enable simulator audio." ON)
|
||||
endif()
|
||||
option(LUA "Enable LUA support" ON)
|
||||
option(LUA_MIXER "Enable LUA mixer/model scripts support" OFF)
|
||||
option(SIMU_DISKIO "Enable disk IO simulation in simulator. Simulator will use FatFs module and simulated IO layer that uses \"./sdcard.image\" file as image of SD card. This file must contain whole SD card from first to last sector" OFF)
|
||||
option(SIMU_LUA_COMPILER "Pre-compile and save Lua scripts in simulator." ON)
|
||||
option(FAS_PROTOTYPE "Support of old FAS prototypes (different resistors)" OFF)
|
||||
@@ -199,7 +200,7 @@ if(RTC_BACKUP_RAM)
|
||||
set(GTEST_SRC ${GTEST_SRC} ${RADIO_SRC_DIR}/storage/rtc_backup.cpp)
|
||||
endif()
|
||||
|
||||
if(NOT LUA STREQUAL NO)
|
||||
if(LUA)
|
||||
add_definitions(-DLUA)
|
||||
if(LUA_COMPILER)
|
||||
add_definitions(-DLUA_COMPILER)
|
||||
@@ -212,7 +213,7 @@ if(NOT LUA STREQUAL NO)
|
||||
endif()
|
||||
include_directories(${LUA_DIR})
|
||||
set(RADIO_DEPENDENCIES ${RADIO_DEPENDENCIES} ${LUA_EXPORT})
|
||||
if(LUA STREQUAL YES)
|
||||
if(LUA_MIXER)
|
||||
add_definitions(-DLUA_MODEL_SCRIPTS)
|
||||
endif()
|
||||
|
||||
@@ -273,6 +274,10 @@ if(NOT LUA STREQUAL NO)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (LUA_MIXER AND NOT LUA)
|
||||
message(FATAL_ERROR "LUA_MIXER requires LUA!!")
|
||||
endif()
|
||||
|
||||
if(HELI)
|
||||
add_definitions(-DHELI)
|
||||
endif()
|
||||
@@ -589,7 +594,7 @@ if(NOT MSVC)
|
||||
# Use newlib nano, which saves a few kilobytes.
|
||||
if(NOT NANO STREQUAL NO)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --specs=nano.specs")
|
||||
if(NOT LUA STREQUAL NO)
|
||||
if(LUA)
|
||||
# Lua needs %g and %f
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -u _printf_float -u _scanf_float")
|
||||
endif()
|
||||
|
||||
@@ -28,7 +28,7 @@ if(FLIGHT_MODES)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(LUA STREQUAL YES)
|
||||
if(LUA_MIXER)
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
model_custom_scripts.cpp
|
||||
|
||||
@@ -28,7 +28,7 @@ if(FLIGHT_MODES)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(LUA STREQUAL YES)
|
||||
if(LUA_MIXER)
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
model_custom_scripts.cpp
|
||||
|
||||
@@ -89,7 +89,7 @@ if(LUA)
|
||||
set(SRC ${SRC} lua/widgets.cpp)
|
||||
endif()
|
||||
|
||||
if(LUA STREQUAL YES)
|
||||
if(LUA_MIXER)
|
||||
add_gui_src(model_mixer_scripts.cpp)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -119,6 +119,7 @@ class FormGridLayoutEx : public FormGridLayout
|
||||
uint8_t _lineHeight = PAGE_LINE_HEIGHT;
|
||||
};
|
||||
|
||||
#if defined(LUA)
|
||||
void buildLuaUi(std::vector<LuaScript> luaScripts, FormWindow *window, FormGridLayoutEx &grid)
|
||||
{
|
||||
for (auto luaScript : luaScripts) {
|
||||
@@ -136,7 +137,7 @@ void buildLuaUi(std::vector<LuaScript> luaScripts, FormWindow *window, FormGridL
|
||||
|
||||
luaExec(luaScript.path.c_str());
|
||||
StandaloneLuaWindow::instance()->attach(window);
|
||||
|
||||
|
||||
return 0;
|
||||
},
|
||||
OPAQUE);
|
||||
@@ -156,7 +157,7 @@ void buildLuaUi(std::vector<LuaScript> luaScripts, FormWindow *window, FormGridL
|
||||
grid.nextLine();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void RadioToolsPage::rebuild(FormWindow * window)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(LUA)
|
||||
#include "libopenui.h"
|
||||
#include "lua/lua_api.h"
|
||||
|
||||
@@ -77,3 +78,4 @@ protected:
|
||||
LuaTouchData touch;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user