Removing LUA from a plugin does not work

Description

CMake compiles with errors when compiling with LUA disabled in config.cmake.

ctl-plugin.c failes to compile.

  • Missing include for "fprintf" // #include <stdio.h>

  • Lua dependent calls are not guarded by #ifdef....#endif

 

************************************************************

[ 44%] Building C object app-controller/ctl-lib/CMakeFiles/ctl-utilities.dir/ctl-action.c.o
[ 48%] Building C object app-controller/ctl-lib/CMakeFiles/ctl-utilities.dir/ctl-config.c.o
[ 52%] Building C object app-controller/ctl-lib/CMakeFiles/ctl-utilities.dir/ctl-onload.c.o
[ 56%] Building C object app-controller/ctl-lib/CMakeFiles/ctl-utilities.dir/ctl-plugin.c.o
/home/M21106/Development/agl/git/4a-hal-integration/4a-hal-unicens/app-controller/ctl-lib/ctl-plugin.c: In function ‘LoadFoundPlugins’:
/home/M21106/Development/agl/git/4a-hal-integration/4a-hal-unicens/app-controller/ctl-lib/ctl-plugin.c:241:16: error: implicit declaration of function ‘LuaLoadScript’ [-Werror=implicit-function-declaration]
if(LuaLoadScript(apiHandle, pluginpath))
^~~~~~~~~~~~~
/home/M21106/Development/agl/git/4a-hal-integration/4a-hal-unicens/app-controller/ctl-lib/ctl-plugin.c: In function ‘GetDefaultPluginSearchPath’:
/home/M21106/Development/agl/git/4a-hal-integration/4a-hal-unicens/app-controller/ctl-lib/ctl-plugin.c:283:33: error: ‘CONTROL_PLUGIN_PATH’ undeclared (first use in this function); did you mean ‘CONTROL_CONFIG_PATH’?
envDirList_len = strlen(CONTROL_PLUGIN_PATH) + strlen(envDirList) + strlen(bindingPath) + strlen(rootDir) + 3;
^~~~~~~~~~~~~~~~~~~
CONTROL_CONFIG_PATH
/home/M21106/Development/agl/git/4a-hal-integration/4a-hal-unicens/app-controller/ctl-lib/ctl-plugin.c:283:33: note: each undeclared identifier is reported only once for each function it appears in
At top level:
/home/M21106/Development/agl/git/4a-hal-integration/4a-hal-unicens/app-controller/ctl-lib/ctl-plugin.c:79:12: warning: ‘DispatchOneL2c’ defined but not used [-Wunused-function]
static int DispatchOneL2c(void* luaState, char *funcname, Lua2cFunctionT callback) {
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
gmake[2]: *** [app-controller/ctl-lib/CMakeFiles/ctl-utilities.dir/build.make:135: app-controller/ctl-lib/CMakeFiles/ctl-utilities.dir/ctl-plugin.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:537: app-controller/ctl-lib/CMakeFiles/ctl-utilities.dir/all] Error 2
gmake: *** [Makefile:130: all] Error 2

Environment

None

Activity

Walt Miner 
December 7, 2018 at 11:53 PM

Close for GG RC2

Romain Forlot 
December 3, 2018 at 2:40 PM

Review #18403 has been merged and solves this issue.

Romain Forlot 
November 29, 2018 at 10:46 AM

Please see my review about this.

Thanks for reporting.

Fixed

Details

Assignee

Reporter

Fix versions

Labels

Contract ID

Components

Priority

Created November 28, 2018 at 8:41 AM
Updated December 7, 2018 at 11:53 PM
Resolved December 3, 2018 at 2:40 PM