diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 5a741df79..15230113d 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -199,7 +199,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 +212,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 +273,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 +593,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() diff --git a/radio/src/gui/128x64/CMakeLists.txt b/radio/src/gui/128x64/CMakeLists.txt index 9cbd14165..d9a9a2971 100644 --- a/radio/src/gui/128x64/CMakeLists.txt +++ b/radio/src/gui/128x64/CMakeLists.txt @@ -28,7 +28,7 @@ if(FLIGHT_MODES) ) endif() -if(LUA STREQUAL YES) +if(LUA_MIXER) set(GUI_SRC ${GUI_SRC} model_custom_scripts.cpp diff --git a/radio/src/gui/212x64/CMakeLists.txt b/radio/src/gui/212x64/CMakeLists.txt index eabf0fd51..3d0e23889 100644 --- a/radio/src/gui/212x64/CMakeLists.txt +++ b/radio/src/gui/212x64/CMakeLists.txt @@ -28,7 +28,7 @@ if(FLIGHT_MODES) ) endif() -if(LUA STREQUAL YES) +if(LUA_MIXER) set(GUI_SRC ${GUI_SRC} model_custom_scripts.cpp diff --git a/radio/src/gui/colorlcd/CMakeLists.txt b/radio/src/gui/colorlcd/CMakeLists.txt index 96fd3ed5e..d0db6bb6b 100644 --- a/radio/src/gui/colorlcd/CMakeLists.txt +++ b/radio/src/gui/colorlcd/CMakeLists.txt @@ -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()