summaryrefslogtreecommitdiffstats
path: root/ctl-lib
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-11-29 11:44:14 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-12 17:44:41 +0100
commit8069ee6bc0366a7ef9b5d19623731c43c6d1d45a (patch)
treedb6e0b99f345d72830410489a6e8eece5a5b1e86 /ctl-lib
parent88d6ac08d92cd62996a8e0667842000958556562 (diff)
Fix: compiling a controller without LUA support
Bug-AGL: SPEC-1979 Change-Id: I92c22136a7e6bca6557a306824f7dc8c0ae2bf47 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib')
-rw-r--r--ctl-lib/ctl-plugin.c5
-rw-r--r--ctl-lib/ctl-plugin.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index be3a2bf..48b79d1 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -235,10 +235,15 @@ static int LoadFoundPlugins(AFB_ApiT apiHandle, json_object *scanResult, json_ob
return -1;
}
else if(ext && !strcasecmp(ext, CTL_SCRIPT_EXT)) {
+#ifndef CONTROL_SUPPORT_LUA
+ AFB_ApiError(apiHandle, "LUA support not selected (cf:CONTROL_SUPPORT_LUA) in config.cmake");
+ return -1;
+#else
ctlPlugin->api = apiHandle;
ctlPlugin->context = handle;
if(LuaLoadScript(apiHandle, pluginpath))
return -1;
+#endif
}
}
diff --git a/ctl-lib/ctl-plugin.h b/ctl-lib/ctl-plugin.h
index 0ae6fbf..56cd465 100644
--- a/ctl-lib/ctl-plugin.h
+++ b/ctl-lib/ctl-plugin.h
@@ -28,6 +28,7 @@ extern "C" {
#define _GNU_SOURCE
#endif
+#include <stdio.h>
#include <json-c/json.h>
#include "afb-definitions.h"