Switch to CMake

This commit is contained in:
Bertrand Songis
2015-12-21 23:43:18 +01:00
parent c8358d7e37
commit 88841f63ca
94 changed files with 1553 additions and 956 deletions
+12
View File
@@ -0,0 +1,12 @@
macro(add_lua_export_target target)
add_custom_command(
OUTPUT lua_exports_${target}.inc
COMMAND ${CMAKE_C_COMPILER} -E ${ARGN} -DEXPORT ${INTTYPES_INCLUDE_OPTION} ${RADIO_SRC_DIRECTORY}/myeeprom.h | grep LEXP > lua_exports_${target}.txt
COMMAND python ${RADIO_DIRECTORY}/util/luaexport.py ${VERSION} lua_exports_${target}.txt lua_exports_${target}.inc lua_fields_${target}.txt
)
add_custom_target(lua_export_${target} DEPENDS lua_exports_${target}.inc)
endmacro(add_lua_export_target)
add_lua_export_target(taranis -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis_x9e -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
add_lua_export_target(horus -DPCBHORUS -DLUA -DVIRTUALINPUTS)
+1 -6
View File
@@ -71,11 +71,6 @@
#define FIND_FIELD_DESC 0x01
struct LuaField {
uint16_t id;
char desc[50];
};
/*luadoc
@function getVersion()
@@ -255,7 +250,7 @@ void luaGetValueAndPush(int src)
/**
Return field data for a given field name
*/
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags=0)
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
{
// TODO better search method (binary lookup)
for (unsigned int n=0; n<DIM(luaSingleFields); ++n) {
+5 -6
View File
@@ -39,16 +39,12 @@
#if defined(LUA)
#if !defined(SIMU)
extern "C" {
#endif
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include <lrotable.h>
#if !defined(SIMU)
}
#endif
extern lua_State *L;
extern bool luaLcdAllowed;
@@ -149,10 +145,13 @@ extern "C" {
#elif defined(PCBHORUS)
#define IS_MASKABLE(key) ((key) != KEY_EXIT && (key) != KEY_ENTER)
#endif
struct LuaField {
uint16_t id;
char desc[50];
};
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags=0);
#else // #if defined(LUA)
#define LUA_LOAD_MODEL_SCRIPTS()
#endif // #if defined(LUA)
#endif // #ifndef lua_api_h