summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJoão Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>2020-09-21 17:59:09 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2021-01-31 11:40:45 -0300
commit9031750e627107ea10657ef99fdfe080eb830c25 (patch)
tree6734da1633e7e109dbc777df3ef4ca29302be78b /src/lib
parente92f822fc8cf49fee57da88267db6c237f54f2d0 (diff)
downloadefl-9031750e627107ea10657ef99fdfe080eb830c25.tar.gz
efl: Make lua support optionaldevs/felipealmeida/delivered
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edje/edje_cache.c2
-rw-r--r--src/lib/edje/edje_data.c2
-rw-r--r--src/lib/edje/edje_load.c8
-rw-r--r--src/lib/edje/edje_message_queue.c2
-rw-r--r--src/lib/edje/edje_private.h12
-rw-r--r--src/lib/edje/edje_program.c2
-rw-r--r--src/lib/edje/edje_smart.c12
-rw-r--r--src/lib/edje/meson.build11
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c53
-rw-r--r--src/lib/evas/filters/meson.build8
10 files changed, 104 insertions, 8 deletions
diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c
index ce61f146fa..c913323406 100644
--- a/src/lib/edje/edje_cache.c
+++ b/src/lib/edje/edje_cache.c
@@ -329,6 +329,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
free(data);
}
+#ifdef HAVE_LUA
snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", id);
data = eet_read(edf->ef, buf, &size);
@@ -337,6 +338,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
_edje_lua2_script_load(edc, data, size);
free(data);
}
+#endif
ce->ref = edc;
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index 020393246d..a7a9ecab9f 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -1302,7 +1302,9 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "part", part, EET_T_STRING);
+#ifdef HAVE_LUA
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR);
+#endif
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "broadcast_signal", broadcast_signal, EET_T_UCHAR);
#ifdef HAVE_EPHYSICS
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 86039e97b0..b5b0b0bf40 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -793,7 +793,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
if (collect)
part_match = eina_hash_string_superfast_new(NULL);
+#ifdef HAVE_LUA
if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
+#endif
#ifdef HAVE_EPHYSICS
/* clear physics world / shutdown ephysics */
@@ -837,12 +839,14 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
ed->groups = eina_list_append(ed->groups, ed);
+#ifdef HAVE_LUA
if (ed->collection->lua_script_only)
{
ed->load_error = EDJE_LOAD_ERROR_NONE;
_edje_lua_script_only_init(ed);
}
else
+#endif
{
unsigned int i;
@@ -2071,7 +2075,9 @@ _edje_file_del(Edje *ed)
ed->seats_count = 0;
}
+#ifdef HAVE_LUA
if (ed->L) _edje_lua2_script_shutdown(ed);
+#endif
while (ed->subobjs)
_edje_subobj_unregister(ed, ed->subobjs->data);
if (ed->table_parts) free(ed->table_parts);
@@ -2370,7 +2376,9 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec
ec->patterns.table_programs_size = 0;
if (ec->script) embryo_program_free(ec->script);
+#ifdef HAVE_LUA
_edje_lua2_script_unload(ec);
+#endif
if (ec->limits.parts) free(ec->limits.parts);
diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index a4da7ea52d..a39a312daf 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -840,11 +840,13 @@ _edje_message_process(Edje_Message *em)
}
/* now this message is destined for the script message handler fn */
if (!(em->edje->collection)) return;
+#ifdef HAVE_LUA
if (em->edje->L)
{
_edje_lua_script_only_message(em->edje, em);
return;
}
+#endif
fn = embryo_program_function_find(em->edje->collection->script, "message");
if (fn == EMBRYO_FUNCTION_NONE) return;
/* reset the engine */
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index ec6a7c407b..3ef6f576c6 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -31,9 +31,11 @@
#include <fcntl.h>
+#ifdef HAVE_LUA
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
+#endif
#include <setjmp.h>
// auto_unref
@@ -1123,7 +1125,9 @@ struct _Edje_Part_Collection
} patterns;
/* *** *** */
+#ifdef HAVE_LUA
unsigned char lua_script_only;
+#endif
unsigned char broadcast_signal;
unsigned char physics_enabled; /* will be 1 if a body is declared */
unsigned char script_recursion; /* permits unsafe Embryo->EDC->Embryo scripting */
@@ -1585,12 +1589,16 @@ struct _Edje
double duration_scale;
double paused_at;
Eina_Hash *user_defined;
+#ifdef HAVE_LUA
lua_State *L;
Eina_Inlist *lua_objs;
+#endif
Eina_Inlist *messages;
+#ifdef HAVE_LUA
int lua_ref;
+#endif
int processing_messages;
int references;
@@ -2718,6 +2726,7 @@ void _edje_embryo_globals_init(Edje *ed);
if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \
*___cptr = (int)val; } }
+#ifdef HAVE_LUA
extern jmp_buf _edje_lua_panic_jmp;
#define _edje_lua_panic_here() setjmp(_edje_lua_panic_jmp)
@@ -2744,6 +2753,7 @@ void _edje_lua_script_only_hide(Edje *ed);
void _edje_lua_script_only_move(Edje *ed);
void _edje_lua_script_only_resize(Edje *ed);
void _edje_lua_script_only_message(Edje *ed, Edje_Message *em);
+#endif
void _edje_entry_init(Edje *ed);
void _edje_entry_shutdown(Edje *ed);
@@ -2868,6 +2878,7 @@ void edje_object_propagate_callback_add(Evas_Object *obj, void (*func) (void *da
EDJE_API void _edje_program_insert(Edje_Part_Collection *ed, Edje_Program *p);
EDJE_API void _edje_program_remove(Edje_Part_Collection *ed, Edje_Program *p);
+#ifdef HAVE_LUA
void _edje_lua2_error_full(const char *file, const char *fnc, int line, lua_State *L, int err_code);
#define _edje_lua2_error(L, err_code) _edje_lua2_error_full(__FILE__, __func__, __LINE__, L, err_code)
void _edje_lua2_script_init(Edje *ed);
@@ -2882,6 +2893,7 @@ void _edje_lua2_script_func_move(Edje *ed);
void _edje_lua2_script_func_resize(Edje *ed);
void _edje_lua2_script_func_message(Edje *ed, Edje_Message *em);
void _edje_lua2_script_func_signal(Edje *ed, const char *sig, const char *src);
+#endif
const char *edje_string_get(const Edje_String *es);
const char *edje_string_id_get(const Edje_String *es);
diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c
index 34b4b5c74c..ee3ffe6312 100644
--- a/src/lib/edje/edje_program.c
+++ b/src/lib/edje/edje_program.c
@@ -1538,8 +1538,10 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
_edje_ref(ed);
_edje_util_freeze(ed);
+#ifdef HAVE_LUA
if (ed->collection && ed->L)
_edje_lua2_script_func_signal(ed, sig, src);
+#endif
if (ed->collection)
{
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index f7ad19fe02..c6fe3409ff 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -166,7 +166,9 @@ _efl_canvas_layout_efl_canvas_group_group_del(Eo *obj, Edje *ed)
_edje_block_violate(ed);
ed->delete_me = 1;
_edje_edjes = eina_inlist_remove(_edje_edjes, EINA_INLIST_GET(ed));
+#ifdef HAVE_LUA
if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
+#endif
#ifdef HAVE_EPHYSICS
/* clear physics world / shutdown ephysics */
if ((ed->collection) && (ed->collection->physics_enabled) && (ed->world))
@@ -200,11 +202,13 @@ _efl_canvas_layout_efl_gfx_entity_position_set(Eo *obj, Edje *ed, Eina_Position2
ed->y = pos.y;
// evas_object_move(ed->clipper, ed->x, ed->y);
+#ifdef HAVE_LUA
if (_edje_lua_script_only(ed))
{
_edje_lua_script_only_move(ed);
return;
}
+#endif
for (i = 0; i < ed->table_parts_size; i++)
{
@@ -314,11 +318,13 @@ _efl_canvas_layout_efl_gfx_entity_size_set(Eo *obj, Edje *ed, Eina_Size2D sz)
#ifdef EDJE_CALC_CACHE
ed->all_part_change = EINA_TRUE;
#endif
+#ifdef HAVE_LUA
if (_edje_lua_script_only(ed))
{
_edje_lua_script_only_resize(ed);
goto super;
}
+#endif
// evas_object_resize(ed->clipper, ed->w, ed->h);
ed->dirty = EINA_TRUE;
_edje_recalc_do(ed);
@@ -335,11 +341,13 @@ _edje_object_show(Eo *obj, Edje *ed)
Edje *edg;
efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
+#ifdef HAVE_LUA
if (_edje_lua_script_only(ed))
{
_edje_lua_script_only_show(ed);
return;
}
+#endif
if (eina_list_count(ed->groups) > 1)
{
EINA_LIST_FOREACH(ed->groups, l, edg)
@@ -362,11 +370,13 @@ _edje_object_hide(Eo *obj, Edje *ed)
Edje *edg;
efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
+#ifdef HAVE_LUA
if (_edje_lua_script_only(ed))
{
_edje_lua_script_only_hide(ed);
return;
}
+#endif
EINA_LIST_FOREACH(ed->groups, l, edg)
if (edg != ed) evas_object_hide(edg->obj);
_edje_emit(ed, "hide", NULL);
@@ -406,7 +416,9 @@ EOLIAN static void
_efl_canvas_layout_efl_file_unload(Eo *obj, Edje *ed)
{
efl_file_unload(efl_super(obj, MY_CLASS));
+#ifdef HAVE_LUA
if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
+#endif
#ifdef HAVE_EPHYSICS
/* clear physics world / shutdown ephysics */
if ((ed->collection) && (ed->collection->physics_enabled) && (ed->world))
diff --git a/src/lib/edje/meson.build b/src/lib/edje/meson.build
index 4f7ccce899..5614fb86f7 100644
--- a/src/lib/edje/meson.build
+++ b/src/lib/edje/meson.build
@@ -124,9 +124,6 @@ edje_src = files([
'edje_entry.c',
'edje_external.c',
'edje_load.c',
- 'edje_lua.c',
- 'edje_lua2.c',
- 'edje_lua_script_only.c',
'edje_main.c',
'edje_match.c',
'edje_message_queue.c',
@@ -152,6 +149,14 @@ edje_src = files([
'edje_part_invalid.c'
])
+if get_option('lua-interpreter') != 'none'
+ edje_src += files([
+ 'edje_lua.c',
+ 'edje_lua2.c',
+ 'edje_lua_script_only.c',
+ ])
+endif
+
edje_lib = library('edje',
edje_src, pub_eo_file_target, priv_eo_file_target,
dependencies: edje_pub_deps + edje_deps + edje_ext_deps,
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 9a8537849a..ff170099fd 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -2,6 +2,7 @@
#include <stdarg.h>
+#ifdef HAVE_LUA
// Lua breaks API all the time
#ifdef ENABLE_LUA_OLD
// For 5.2 --> 5.1 compatibility
@@ -13,6 +14,7 @@
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
+#endif
#define FILTERS_LEGACY_COMPAT
@@ -242,15 +244,17 @@ static struct
{ "stretch_xy", EVAS_FILTER_FILL_MODE_STRETCH_XY }
};
+#ifdef HAVE_LUA
static const char *_lua_buffer_meta = "buffer";
static const char *_lua_color_meta = "color";
#define _lua_methods_table "__methods"
#define _lua_register_func "__register"
#define _lua_errfunc_name "__backtrace"
-static Evas_Filter_Fill_Mode _fill_mode_get(Evas_Filter_Instruction *instr);
static Eina_Bool _lua_instruction_run(lua_State *L, Evas_Filter_Instruction *instr);
static int _lua_backtrace(lua_State *L);
+#endif
+static Evas_Filter_Fill_Mode _fill_mode_get(Evas_Filter_Instruction *instr);
typedef enum
{
@@ -293,7 +297,9 @@ struct _Instruction_Param
Buffer *buf;
struct {
void *data;
+#ifdef HAVE_LUA
Eina_Bool (*func)(lua_State *L, int i, Evas_Filter_Program *, Evas_Filter_Instruction *, Instruction_Param *);
+#endif
} special;
} value;
Eina_Bool set : 1;
@@ -308,7 +314,9 @@ struct _Evas_Filter_Instruction
int /*Evas_Filter_Mode*/ type;
Eina_Inlist /* Instruction_Param */ *params;
int return_count;
+#ifdef HAVE_LUA
Eina_Bool (* parse_run) (lua_State *L, Evas_Filter_Program *, Evas_Filter_Instruction *);
+#endif
struct
{
int (* update) (Evas_Filter_Program *, Evas_Filter_Instruction *, int *, int *, int *, int *);
@@ -328,8 +336,10 @@ struct _Evas_Filter_Program
} pad;
Efl_Canvas_Filter_State state;
Eina_Inlist *data; // Evas_Filter_Data_Binding
+#ifdef HAVE_LUA
lua_State *L;
int lua_func;
+#endif
int last_bufid;
Eina_Bool valid : 1;
Eina_Bool padding_calc : 1; // Padding has been calculated
@@ -382,7 +392,9 @@ _instruction_param_addv(Evas_Filter_Instruction *instr, const char *name,
param->value.c = va_arg(args, DATA32);
break;
case VT_SPECIAL:
+#ifdef HAVE_LUA
param->value.special.func = va_arg(args, typeof(param->value.special.func));
+#endif
param->value.special.data = va_arg(args, void *);
break;
case VT_NONE:
@@ -616,6 +628,7 @@ _buffer_get(Evas_Filter_Program *pgm, const char *name)
return NULL;
}
+#ifdef HAVE_LUA
static Eina_Bool
_lua_buffer_push(lua_State *L, Buffer *buf)
{
@@ -721,6 +734,7 @@ _lua_implicit_metatable_drop(lua_State *L, const char *name)
}
return ret;
}
+#endif
// End of all lua metamethods and stuff
@@ -787,7 +801,9 @@ _buffer_add(Evas_Filter_Program *pgm, const char *name, Eina_Bool alpha,
buf->h = pgm->state.h;
pgm->buffers = eina_inlist_append(pgm->buffers, EINA_INLIST_GET(buf));
+#ifdef HAVE_LUA
_lua_buffer_push(pgm->L, buf);
+#endif
return buf;
}
@@ -803,6 +819,7 @@ _buffer_del(Buffer *buf)
static const int this_is_not_a_cat = 42;
+#ifdef HAVE_LUA
static Evas_Filter_Program *
_lua_program_get(lua_State *L)
{
@@ -813,6 +830,7 @@ _lua_program_get(lua_State *L)
lua_pop(L, 1);
return pgm;
}
+#endif
/* Instruction definitions */
@@ -850,6 +868,7 @@ _lua_program_get(lua_State *L)
@since 1.10
*/
+#ifdef HAVE_LUA
static Eina_Bool
_buffer_instruction_parse_run(lua_State *L,
Evas_Filter_Program *pgm,
@@ -915,6 +934,7 @@ _lua_buffer_new(lua_State *L)
return instr->return_count;
}
+#endif
static int
_blend_padding_update(Evas_Filter_Program *pgm EINA_UNUSED,
@@ -1212,6 +1232,7 @@ _bump_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *ins
return EINA_TRUE;
}
+#ifdef HAVE_LUA
static Eina_Bool
_lua_curve_points_func(lua_State *L, int i, Evas_Filter_Program *pgm EINA_UNUSED,
Evas_Filter_Instruction *instr, Instruction_Param *param)
@@ -1344,6 +1365,7 @@ _lua_curve_points_func(lua_State *L, int i, Evas_Filter_Program *pgm EINA_UNUSED
return EINA_TRUE;
}
+#endif
/**
@page evasfiltersref
@@ -1404,7 +1426,9 @@ _curve_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *in
// TODO: Allow passing an array of 256 values as points.
// It could be easily computed from another function in the script.
+#ifdef HAVE_LUA
_instruction_param_seq_add(instr, "points", VT_SPECIAL, _lua_curve_points_func, NULL);
+#endif
if (instr->params)
{
last = instr->params->last;
@@ -1934,8 +1958,10 @@ evas_filter_program_del(Evas_Filter_Program *pgm)
if (!pgm) return;
+#ifdef HAVE_LUA
if (pgm->L)
lua_close(pgm->L);
+#endif
EINA_INLIST_FREE(pgm->buffers, buf)
{
@@ -1954,6 +1980,7 @@ evas_filter_program_del(Evas_Filter_Program *pgm)
}
// [-1, +1, e] -- converts the top of the stack to a valid 'color' object
+#ifdef HAVE_LUA
static Eina_Bool
_lua_convert_color(lua_State *L)
{
@@ -2102,6 +2129,7 @@ fail:
ERR("Invalid value for parameter %s", param->name);
return luaL_error(L, "Invalid value for parameter %s", param->name);
}
+#endif
static Instruction_Param *
_parameter_get_by_id(Evas_Filter_Instruction *instr, int id)
@@ -2119,6 +2147,7 @@ _parameter_get_by_id(Evas_Filter_Instruction *instr, int id)
return NULL;
}
+#ifdef HAVE_LUA
static Eina_Bool
_lua_instruction_run(lua_State *L, Evas_Filter_Instruction *instr)
{
@@ -2389,6 +2418,7 @@ _lua_import_class(lua_State *L, const char *name, char **code)
}
return EINA_TRUE;
}
+#endif
static void
_filter_program_buffers_set(Evas_Filter_Program *pgm)
@@ -2426,6 +2456,7 @@ _filter_program_buffers_set(Evas_Filter_Program *pgm)
}
}
+#ifdef HAVE_LUA
static inline void
_lua_class_create(lua_State *L, const char *name,
const luaL_Reg *meta, const luaL_Reg *methods)
@@ -2596,6 +2627,7 @@ _lua_backtrace(lua_State *L)
lua_call(L, 2, 1); /* call debug.traceback */
return 1;
}
+#endif
#ifdef FILTERS_LEGACY_COMPAT
// This function is here to avoid breaking the ABI too much.
@@ -2722,6 +2754,7 @@ _legacy_strdup(const char *str)
static Eina_Bool
_filter_program_state_set(Evas_Filter_Program *pgm)
{
+#ifdef HAVE_LUA
lua_State *L = pgm->L;
// TODO:
@@ -2820,13 +2853,18 @@ _filter_program_state_set(Evas_Filter_Program *pgm)
#undef JOINC
#undef SETFIELD
#undef SETCOLOR
+#else
+ return EINA_FALSE;
+#endif
}
static Eina_Bool
_filter_program_reset(Evas_Filter_Program *pgm)
{
Evas_Filter_Instruction *instr;
+#ifdef HAVE_LUA
lua_State *L = pgm->L;
+#endif
Eina_Inlist *il;
Buffer *buf;
@@ -2840,8 +2878,10 @@ _filter_program_reset(Evas_Filter_Program *pgm)
// Clear out buffers
EINA_INLIST_FOREACH_SAFE(pgm->buffers, il, buf)
{
+#ifdef HAVE_LUA
lua_pushnil(L);
lua_setglobal(L, buf->name);
+#endif
pgm->buffers = eina_inlist_remove(pgm->buffers, EINA_INLIST_GET(buf));
_buffer_del(buf);
}
@@ -2858,8 +2898,9 @@ _filter_program_reset(Evas_Filter_Program *pgm)
EVAS_API Eina_Bool
evas_filter_program_parse(Evas_Filter_Program *pgm, const char *str)
{
+ Eina_Bool ok = EINA_FALSE;
+#ifdef HAVE_LUA
lua_State *L;
- Eina_Bool ok;
EINA_SAFETY_ON_NULL_RETURN_VAL(pgm, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(str, EINA_FALSE);
@@ -2913,6 +2954,7 @@ evas_filter_program_parse(Evas_Filter_Program *pgm, const char *str)
pgm->valid = ok;
pgm->padding_calc = EINA_FALSE;
pgm->changed = EINA_FALSE;
+#endif
return ok;
}
@@ -3628,6 +3670,7 @@ evas_filter_context_program_use(void *engine, void *output,
{
pgm->changed = EINA_FALSE;
_filter_program_reset(pgm);
+#ifdef HAVE_LUA
lua_getglobal(pgm->L, _lua_errfunc_name);
lua_rawgeti(pgm->L, LUA_REGISTRYINDEX, pgm->lua_func);
success = !lua_pcall(pgm->L, 0, LUA_MULTRET, -2);
@@ -3637,6 +3680,10 @@ evas_filter_context_program_use(void *engine, void *output,
ERR("Lua execution failed: %s", msg);
goto end;
}
+#else
+ ERR("Lua execution failed: Lua was disabled in this build.");
+ goto end;
+#endif
}
// Create or update all buffers
@@ -3668,6 +3715,8 @@ end:
void
evas_filter_parser_shutdown(void)
{
+#ifdef HAVE_LUA
free(_lua_color_code);
_lua_color_code = NULL;
+#endif
}
diff --git a/src/lib/evas/filters/meson.build b/src/lib/evas/filters/meson.build
index 58ff2f21d1..315bec45b0 100644
--- a/src/lib/evas/filters/meson.build
+++ b/src/lib/evas/filters/meson.build
@@ -1,4 +1,8 @@
-subdir('lua')
+if get_option('lua-interpreter') != 'none'
+ subdir('lua')
+
+ evas_deps += lua
+endif
evas_src += files([
'evas_filter.c',
@@ -6,5 +10,3 @@ evas_src += files([
'evas_filter_private.h',
'evas_filter_utils.c',
])
-
-evas_deps += lua